nb.alexiev
nb.alexiev

Reputation: 389

Endless loop with request dispatched to JspServlet on WebLogic 11g

I have the following configuration:

ServletA (in my case Apache CXFserlet - but this is not important), which is matching all requests - /*. ServletB, which is doing dispatch to a named servlet - "jsp" if it is available or "JspServlet" otherwise.

ServletA is configured so that it is forwarding to ServletB all JSP requests. This is working perfect.

On the other hand ServletB is doing forward to "org.apache.jasper.servlet.JSPServlet" if the application is running on Tomcat or to "weblogic.servlet.JSPServlet" if I'm using Oracle Weblogic.

Everything is working perfect on Tomcat.

On Weblogic, I have the following problem: ServletA is forwarding to ServletB it forwards to weblogic.servlet.JSPServlet. The JSPServlet is supposed to serve the JSP but it does not. Instead of this I get to an endless loop (ServletA -> ServletB -> JSPServlet -> ServletA -> ...)

Does anyone have an idea what is going on inside weblogic.servlet.JSPServlet, and have any idea how I can get Weblogic to serve my JSP? All ideas and suggestions are welcome... I have already invested too much time in this problem without any success.

NOTES:

Upvotes: 0

Views: 616

Answers (1)

Parthan
Parthan

Reputation: 11

I think its the new Servlet 2.5 specs which Weblogic strictly enforces when it comes to URL mapping.

  • A servlet path string that contains only the / (forward slash) character indicates the default servlet of the application. The servlet path resolves to the request URI minus the context path; in this case, the path resolves to null.
  • A String that begins with an * (asterisk) specifies an extension mapping.

These changes introduce a change in behavior with the following HttpServletRequest methods:

  • getPathInfo
  • getServletPath

To better illustrate the change in behavior, consider the request /abc/def.html that resolves to ServletA:

  • If / maps to ServletA, then servletPath="abc/def.html" and pathInfo=null.
  • If /* maps to ServletA, then servletPath="" and pathInfo="abc/def.html".

To ensure that the path info returned is non-null, replace all occurrences of the / (forward slash) servlet mapping string with /*.

Upvotes: 1

Related Questions