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 can we upload the file to the server using servlet?
How do I use cookies to store session state on the client?
What do you mean by deployment descriptor?
How can you use a servlet to generate a plain text instead of html?
Can we get PrintWriter and ServletOutputStream both in a servlet?
List the Different types of servlet?
Who is responsible for writing a constructor?
What are the types of Session Tracking ?
What is servletconfig?
Explain the custom jsp tags and the beans.
What is the dispatcher servlet?
What is the difference between ExecuteUpdate and ExecuteQuery?