how can we create object to a class in a jsp file?

Answers were Sorted based on User's Feedback



how can we create object to a class in a jsp file?..

Answer / samuel.j

use the page import tag to import ur class and execute
methods of the class

< % @ page import = packageName.Classname %>
<%

ImportedClass object = new ImportedClass();
object.executeMethods();

%>

Please check for some documentation as to including XSLT in
JSP

Is This Answer Correct ?    60 Yes 24 No

how can we create object to a class in a jsp file?..

Answer / upender

you can create with help of useBean tag also.

<jsp:useBean id="beanId' class="packagename.ClassName" />

Is This Answer Correct ?    30 Yes 15 No

how can we create object to a class in a jsp file?..

Answer / ravikiran.chd

inside the declaration tag

Is This Answer Correct ?    12 Yes 7 No

how can we create object to a class in a jsp file?..

Answer / shane rajasinghe

Creating The Object
<% MyBean student=new MyBean(); %>
*************************************************
calling attributes in the created object
<jsp:getStudentInfo name="student" property="name"/>
<jsp:getStudentInfo name="student" property="dit"/>
*****************************************************

Is This Answer Correct ?    7 Yes 11 No

how can we create object to a class in a jsp file?..

Answer / sant kumar

class name = new class name();

Is This Answer Correct ?    9 Yes 18 No

Post New Answer

More Servlets Interview Questions

How can the session in servlet can be destroyed?

0 Answers  


What is http servlet in java?

0 Answers  


What’s the difference between sendredirect and forward methods

0 Answers  


How do you pass the data from one servlet to another servlet?

11 Answers   HCL,


In servlets, Why do we need both GET and POST method implementations?

3 Answers   IBM,






What is the difference between Difference between doGet() and doPost()?

0 Answers  


What are the classes and interfaces for servlets?

4 Answers  


How to generate the server side programming and the advantages of it over the other languages?

0 Answers  


How to pass a requrest object of one servlet as a request object to another servlet?

4 Answers   Verizon,


How do you load an image in a Servlet?

0 Answers  


hi actully i hav form columns with origin and destination names .as like as i need to create one more column with name amount. my requirement is when i select origin and destination columns automatically i need to get amount from database.how can i. please tel me with relative code

0 Answers   CTS,


What is webservlet?

0 Answers  


Categories