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 |
What is api in servlet?
My Question is that i am using <image> tag in my servlet and after compilation after that calling by url in my browser then images are not showing. Sometime images are showing and sometime is not showing. I am using Tomcat to run my servlets. Tell me if there any specification for image in servlets or what is solution for this ??
What is the purpose of inter-servlet communication?
What’s the difference between forward() and sendredirect() methods?
Explain jsessionid and when is it created?
Why HttpServlet class is declared abstract?
Can you explain in detail 'javax.servlet' package?
how the server will know its the same jsp page?
What is the type of method for sending request from http server?
If servlet receives multiple requests, how many objects will it create?
Which java application server is the best?
What is the process to implement doget and dopost methods?