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 do you load an image in a Servlet?

0 Answers  


What is a generic servlet?

0 Answers  


What is meant by servlet? What are the parameters of the service method?

0 Answers  


What are cookies and how will you use them?

3 Answers  


What are the different methods involved in generic servlet?

0 Answers  






1.HttpSession 2.Hidden fields 3.URL Rewriting these primitive type of Session maintainance. What is the other type of process that could help to maintain the Session? pls Explain the process if u know?

5 Answers   OnMobile,


What is lazy loading and what is Generic Servlet Class?

0 Answers  


What is servlet name in web xml?

0 Answers  


Why is a constructor needed in a servlet even if we use the init method?

0 Answers  


Write a servlet to upload file on server.

0 Answers  


Explain is servlet mapping?

0 Answers  


Which HTTP method is non-idempotent?

0 Answers  


Categories