File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Jsp class could not be compiled error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp class could not be compiled error " Watch "Jsp class could not be compiled error " New topic

Jsp class could not be compiled error

asha austin

Joined: Jan 08, 2011
Posts: 1
hello all am a newbie in JSP nd servlets am facing this error when i try to run my JSP page through tomcat

type Exception report


description The server encountered an internal error () that prevented it from fulfilling this request.


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

An error occurred at line: 8 in the jsp file: /Counter.jsp
Counter cannot be resolved
5: <body>
7: <%
8: out.println(Counter.getCounter());
9: %>
11: </body>

Please help
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

If you are a newbie to JSP you should be learning to do things the right way right off the bat. Putting Java code in JSPs with scriptlet syntax (<% and %>) is a practice that has been discredited for over 9 years now. You should not be doing it.

Be sure that whatever tutorial or reference that you are using to learn JSP focuses on the JSTL (JSP Standard Tag Library) and the EL (Expression Language), and does not focus on Java scriptlets.

[Asking smart questions] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: Jsp class could not be compiled error
It's not a secret anymore!