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 |
Why is servlet used?
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?
Can you send the mail from a servlet ,if yes tell how?
How to get the current httpsession object?
What are the life cycle methods of the servlet?
What are sessions in servlets?
What are the steps that are involved in using the httpservlet class?
What are the different methods involved in the process of session management in servlets?
How can you push data from an Applet to a Servlet?
How are filters?
Define declaration.
Is classes folder is compulsory in web-inf/ even though u r deploying ur application with war file?