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 |
Define the life cycle of a servlets.
What is servlet in web technology?
Hi Frieds, I am new to servlet why to use servlet in webapplication. what i know is " use servlet as a controller in mvc and to implemnent business logic . is it correct ? One more thing reason for implementing business logic with servlets , why not jsp.
Difference between java beans & servlets?
which method in doGet or doPost is use to send binary date to server
What is difference between Forward() and sendRedirect() methode?
Hi guys.. Well can u tell me that why there is need of "init()" , i mean why can not we initialize the servlet object with the help of constructors? Thank you.
Whether we can get deadlock situation in servlets?
What is the default http method in the servlet?
What is cookies in servlet with example?
Is servlet thread safe?
Explain the lifecycle of a servlet?