Details
Description
In test case (I will attatch it,inludes two webapps.),There are four jsp :ForwardForward.jsp,ForwardInclude.jsp,IncludeForward.jsp and IncludeInclude.jsp.When i test
IncludeForward.jsp ,the case throw error in server. The case do the following actions:
IncludeForward.jsp ----include--->LoginForward.jsp-------forward------>RealLogin.jsp
When LoginForward.jsp forward RealLogin.jsp,there is recursion invoke in jetty server and the server will throw StackOverfFowException at last.
I advise the following code change to fix the issue.
In org.mortbay.jetty.servlet.ServletHandler.java
In about line 323 (In method handle(String target, HttpServletRequest request,HttpServletResponse response, int type)):
if (type==INCLUDE)
{ base_request.setAttribute(Dispatcher.__INCLUDE_SERVLET_PATH,servlet_path); base_request.setAttribute(Dispatcher.__INCLUDE_PATH_INFO, path_info); }else
{ base_request.setServletPath(servlet_path); base_request.setPathInfo(path_info); }
-------------------------->
if (type==INCLUDE)
{ base_request.setAttribute(Dispatcher.__INCLUDE_SERVLET_PATH,servlet_path); base_request.setAttribute(Dispatcher.__INCLUDE_PATH_INFO, path_info); }
else
{ base_request.removeAttribute(Dispatcher.__INCLUDE_SERVLET_PATH); base_request.removeAttribute(Dispatcher.__INCLUDE_PATH_INFO); base_request.setServletPath(servlet_path); base_request.setPathInfo(path_info); }
This issue was resolved in the jetty-6.1.12 release.
cheers!