• Post Reply Bookmark Topic Watch Topic
  • New Topic

simple jsp:JasperException  RSS feed

 
Nandini Sriram
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am new to JSP and in the process of learning the basics. I am trying to run an HTML file which calls a JSP in turn. I am getting some exceptions. Please tell me if my directory structure is correct.
I have created a directory for JSP like this -
C:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\myOwnDir_for_jsp
I am trying to do a JSP that uses java classes (User and UserIO) that belong to 2 different packages(say A & B respectively).
File paths for these is -
C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes\A and
C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes\B
A part of my jsp file(inside myOwnDir_for_jsp) is seen below:
All compiled and when I try to run the HTML, I get this-
HTTP status 500
org.apache.jasper.JasperException: A/User
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
..
...
RootCause
javax.servlet.ServletException: A/User
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:536)
at org.apache.jsp.sai_jsp._jspService(sai_jsp.java:93)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
...

Can someone guide me as to where my mistake lies?
Thanks
Nandini
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since your JSP is in the "default" web application, the compiler is not seeing classes in the "examples" web application. In the servlet API, web applications are treated like separate programs to ensure security.
Either put your JSP in "examples" or copy the classes to ROOT\WEB-INF\classes
Bill
 
Nandini Sriram
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. It's working now.
Regards
Nandini
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!