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

Define the life cycle of a servlets.

0 Answers  


What is servlet in web technology?

0 Answers  


Hi Frieds, I am new to servlet why to use servlet in webapplication. what i know is " use servlet as a controller in mvc and to implemnent business logic . is it correct ? One more thing reason for implementing business logic with servlets , why not jsp.

4 Answers  


Difference between java beans & servlets?

0 Answers  


which method in doGet or doPost is use to send binary date to server

2 Answers   HCL,






What is difference between Forward() and sendRedirect() methode?

14 Answers   Polaris,


Hi guys.. Well can u tell me that why there is need of "init()" , i mean why can not we initialize the servlet object with the help of constructors? Thank you.

7 Answers  


Whether we can get deadlock situation in servlets?

0 Answers  


What is the default http method in the servlet?

0 Answers  


What is cookies in servlet with example?

0 Answers  


Is servlet thread safe?

0 Answers  


Explain the lifecycle of a servlet?

0 Answers  


Categories