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?
Is servlet a controller?
How many servlet objects are created?
How to upload a file to the server using servlet?
What is the servlet?
What are the exceptions thrown by servlets? Why?
What is the effective way to make sure all the servlets are accessible only when user has a valid session?
What are its drawbacks of cgi?
What is java servlet?
What is the advantage of Servlets when compared with other server side technologies?
What is a cookie What is the difference between session and cookie
What is difference between ServletResponse sendRedirect() and RequestDispatcher forward() method?