Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -80,9 +81,9 @@ public static String getPath(HttpServletRequest request)
// will return the original (wrong) URI requested. The following special
// attribute holds the correct path. See section 8.3 of the Servlet
// 2.3 specification.
String path = (String)request.getAttribute("javax.servlet.include.servlet_path");
String path = (String)request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
// also take into account the PathInfo stated on SRV.4.4 Request Path Elements
String info = (String)request.getAttribute("javax.servlet.include.path_info");
String info = (String)request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO);
if (path == null)
{
path = request.getServletPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ public class WebappResourceLoader extends ResourceLoader
/**
* This is abstract in the base class, so we need it.
* <br>
* NOTE: this expects that the ServletContext has already
* NOTE: this expects that the {@link ServletContext} has already
* been placed in the runtime's application attributes
* under its full class name (i.e. "javax.servlet.ServletContext").
* under its full class name.
*
* @param configuration the {@link ExtProperties} associated with
* this resource loader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.io.StringWriter;
import java.net.URL;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -80,8 +81,8 @@ public void testGetTemplateHttpServletRequestHttpServletResponse() throws Resour
expect(config.getInitParameter(VelocityView.TOOLS_KEY)).andAnswer(eval(null));
expect(servletContext.getAttribute(ServletUtils.CONFIGURATION_KEY)).andAnswer(eval((String)null));
expect(servletContext.getResource(VelocityView.USER_TOOLS_PATH)).andAnswer(eval(null));
expect(request.getAttribute("javax.servlet.include.servlet_path")).andAnswer(eval("/charset-test.vm"));
expect(request.getAttribute("javax.servlet.include.path_info")).andAnswer(eval((String)null));
expect(request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH)).andAnswer(eval("/charset-test.vm"));
expect(request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO)).andAnswer(eval((String)null));

// This was necessary to verify the bug, now it is not called at all.
// expect(response.getCharacterEncoding()).andReturn("ISO-8859-1");
Expand Down