aspose file tools*
The moose likes JSP and the fly likes org. apache. jasper. JasperException :  Unable to compile class for JSP: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "org. apache. jasper. JasperException :  Unable to compile class for JSP:" Watch "org. apache. jasper. JasperException :  Unable to compile class for JSP:" New topic
Author

org. apache. jasper. JasperException : Unable to compile class for JSP:

Aniket pashine
Greenhorn

Joined: Nov 05, 2008
Posts: 2
hi all
this is my first post and am new to java am trying to test the code given in headfirst jsp&Servlet

this is my very basic code

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<table>
<tr>
<td>Enter FirstName : <input type="text" id="name" name="name"></td>
</tr>
<tr>
<td>Enter LastName : <input type="text" id="lastname" name="lastname"></td>
</tr>
</table>
<jsp:useBean id="person" class="PersonDetails">
<jsp:setProperty name="person" property="*" />
</jsp:useBean>

<input type="submit" value="Submit">


</body>
</html>

but i am getting this error

SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 19 in the jsp file: /jsp/EntryPage.jsp
PersonDetails cannot be resolved to a type
16: <td>Enter LastName : <input type="text" id="lastname" name="lastname"></td>
17: </tr>
18: </table>
19: <jsp:useBean id="person" class="PersonDetails">
20: <jsp:setProperty name="person" property="*" />
21: </jsp:useBean>
22:


An error occurred at line: 19 in the jsp file: /jsp/EntryPage.jsp
PersonDetails cannot be resolved to a type
16: <td>Enter LastName : <input type="text" id="lastname" name="lastname"></td>
17: </tr>
18: </table>
19: <jsp:useBean id="person" class="PersonDetails">
20: <jsp:setProperty name="person" property="*" />
21: </jsp:useBean>
22:


An error occurred at line: 19 in the jsp file: /jsp/EntryPage.jsp
PersonDetails cannot be resolved to a type
16: <td>Enter LastName : <input type="text" id="lastname" name="lastname"></td>
17: </tr>
18: </table>
19: <jsp:useBean id="person" class="PersonDetails">
20: <jsp:setProperty name="person" property="*" />
21: </jsp:useBean>
22:


Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

what should i do

am using eclips , toncate 6 , xp

thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42932
    
  68
Welcome to JavaRanch.

It looks as if the PersonDetails class is not in a package - all JSP beans need to be in a package.

You'll also need a JSP import statement for that package/class.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org. apache. jasper. JasperException : Unable to compile class for JSP: