DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39577>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39577

           Summary: JSPs in subdirectories can't access classes
           Product: Tomcat 5
           Version: 5.5.17
          Platform: PC
               URL: http://www.mslinn.com/includes/test.jsp
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P3
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


JSPs in subdirectories can't access classes in WEB-INF/classes or WEB-INF/lib. 
For example, if webapps/ROOT/x.jsp contains:
<pre><% com.mslinn.util.Test test = new com.mslinn.util.Test(); %>
<%=test.test()%></pre>
and Test is very short:
<pre>package com.mslinn.util; 
public class Test {
           public Test() {}
           public String test() { return "Ya varmint!";}
}</pre>
Then the JSP will compile and run properly.  If, however, the JSP is moved to
/webapps/ROOT/blah/x.jsp then errors result:
<pre>HTTP Status 500 -

type Exception report

message

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

exception

org.apache.jasper.JasperException: Exception in JSP: /x.jsp:2

1: <% com.mslinn.util.Test test = new com.mslinn.util.Test(); %>
2: <%=test.test()%>


Stacktrace:
        
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

javax.servlet.ServletException: com.mslinn.util.Test.test()Ljava/lang/String;
        
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
        
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
        org.apache.jsp.x_jsp._jspService(x_jsp.java:51)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoSuchMethodError: com.mslinn.util.Test.test()Ljava/lang/String;
        org.apache.jsp.x_jsp._jspService(x_jsp.java:44)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17</pre>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to