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

Why is servlet used?

0 Answers  


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

0 Answers  


Can you send the mail from a servlet ,if yes tell how?

2 Answers  


How to get the current httpsession object?

0 Answers  


What are the life cycle methods of the servlet?

0 Answers  






What are sessions in servlets?

0 Answers  


What are the steps that are involved in using the httpservlet class?

0 Answers  


What are the different methods involved in the process of session management in servlets?

0 Answers  


How can you push data from an Applet to a Servlet?

0 Answers  


How are filters?

0 Answers  


Define declaration.

0 Answers  


Is classes folder is compulsory in web-inf/ even though u r deploying ur application with war file?

3 Answers   Bosch, Cognizant,


Categories