has anyone made experience with including (ie. processing) a dynamic
resource (JSP) from within a custom JSP tag?
Using the following code inside doEndTag():
pageContext.include("/templates/blub.jsp");
throws a ServletException (Note: the JSP is a part of the web app
which is deployed as war). Does it make a difference if the web
application is warred up into and therefore include cannot resolve the
specified relative URL?
[Tomcat 4.1.10 doesn't have problems for that matter]
The full stack trace is:
javax.servlet.ServletException: java.lang.NullPointerException
at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
at jsp_servlet._models.__index._jspService(__index.java:774)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
TIA,
niko.
Niko Schmuck wrote:
--
Rajesh Mirchandani
Developer Relations Engineer
BEA Support
Thanks for your hint. I actually have done this right after posting my
question to the newsgroup and figured out that I get the completely
same ServletException thrown. That made me think that the JSP makes
trouble which is include from the tag, and that really was the case.
Conclusion: it would be very nice (and easier to debug) if WebLogic
wouldn't hide the exception stack that arouse the problem when
PageContext.include(resourcePath) was invoked.
Cheers,
Niko.