You are doing a runtime include of a file that doesn't have jsp extensions. (Hint - do view source on your result page)

I thought jspf were meant for compile time includes. (As a naming convention, but not dicated, but then again ... I didn't have my morning coffee yet)

Anyhoo, add jspf as a mapping to the JSP Servlet. You can do that in $CATALINA_HOME/conf/server.xml or in your local webapp's web.xml.

Or you can rename your include to have the file extension jsp.

-Tim

Sng Wee Jim wrote:
Hi,

I am using Jakarta tomcat 5.0.24 on Windows 2000.

I have 2 files, 1.jsp which includes 2.jspf

Content of 1.jsp
        <%
        pageContext.setAttribute("aaa", "111");
        System.out.println("in 1.jsp: " + pageContext.getAttribute("aaa"));
        %>

        <jsp:include page="2.jspf"/>

        <%
        System.out.println("after, in 1.jsp: " +
pageContext.getAttribute("aaa"));
        %>


Content of 2.jspf <br> 22222 <% System.out.println("\n\n\n\n"); System.out.println("in 2.jspf: " + pageContext.getAttribute("aaa")); //String s = null; //s.length(); pageContext.setAttribute("aaa", "2222"); %> 3333

The strange thing is that when 1.jsp is run, the System.out.println from
2.jspf is not shown in the tomcat console.
Also when the 2 lines
        Stirng s = null;
        s.lenght();
is uncommented, the NullPointerException stack trace is not shown in the
tomcat console too. (If we copy the 2 lines to 1.jsp, we will be able to see
the stacktrace.)

Is this a bug?


- Jim

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



Reply via email to