how can we create object to a class in a jsp file?
Answers were Sorted based on User's Feedback
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 |
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 |
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 would you create deadlock on your servlet?
How can a servlet be used to generate plain text instead of html?
What is the <load-on-startup> element?
What is servlet in simple terms?
How native code can be used in a servlet?
What are the differences between forward() method and sendredirect() methods?
Explain in brief the directory structure of a web application?
how a servlet is instantiated, whether the container calls init() or by calling any other method? please somebody reply..
What is a deployment descriptor?
What is the purpose of inter-servlet communication?
What are the difference between session and cookies in servlet? Explain
What is the use of httpservletrequestwrapper?