Hai All,
I created a small JSP File which uses a java Bean, iam using
jsp1.0 Reference implementation under win'98.
when i was accessing that jsp file it gives error
message:
i placed my Hello.jsp in
c:\jsp1.0\examples\jsp\myjsp\ directory
and i placed my Java Class File Hello.class in
C:\jsp1.0\examples\WEB-INF\jsp\beans\myjsp\ directory
The Message is as Follows :
Unhandled error! You might want to consider having an error page to report
such errors more gracefully
com.sun.jsp.JspException: Unknown exception: javax.servlet.ServletException: Cannot create bean of class myjsp.Hello
at C_0003a.jsp1_0.examples.jsp.myjsp.Hello_jsp_1._jspService(Hello1_jsp_.java:51)
at com.sun.jsp.runtime.HttpJspBase.service(HttpJspBase.java:43)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:78)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:125)
at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:152)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
at com.sun.web.core.Context.handleRequest(Context.java:382)
at com.sun.web.server.ConnectionHandler.run(Compiled Code)**********************************************************************************************************************************************
My JSP File Hello.jsp is as Follows
:
<jsp:useBean id="hello" scope="request" class="myjsp.Hello" />
<%= hello.getMessg() %>
**********************************************************************************************************************************************
My Hello.java Program is as Follows
package myjsp;
public class Hello {
public String getMessage()
{
return "Hello World";
} // end getMessage
} // end Hello class
return "Hello World";
} // end getMessage
} // end Hello class
**********************************************************************************************************************************************
Can somebody tell me where iam doing wrong, is
it the right way to create a java bean or should Hello.java implement
serializable
interface.
Any help would be greatly appreciated
Thanks a lot in Advance
Regards
Mahesh
