-
Bug
-
Resolution: Done
-
Major
-
7.3.6.GA
-
False
-
False
-
-
-
-
-
-
Undefined
-
-
-
JSP files can be updated and changes can automatically be detected through XNIO FilySystemWatcher for the exploded deployment. So, the next request can basically trigger recompiling of the updated JSP file without redeployment.
However, JSP recompile does not happen when a request is forward to the JSP file with a non-canonicalize path.
—
For example, when the application contains the following JSP file that forwards to a JSP with multiple slashes "//" in the path:
<% // RequestDispatcher dispatcher = request.getRequestDispatcher("test/example.jsp"); // OK // RequestDispatcher dispatcher = request.getRequestDispatcher("test//example.jsp"); // OK // RequestDispatcher dispatcher = request.getRequestDispatcher("/test/example.jsp"); // OK // RequestDispatcher dispatcher = request.getRequestDispatcher("//test/example.jsp"); // recompile is not triggered even after example.jsp is updated RequestDispatcher dispatcher = request.getRequestDispatcher("/test//example.jsp"); // recompile is not triggered even after example.jsp is updated dispatcher.forward(request, response); %>
in the following directory structure:
example.war
├── index.jsp
├── test
│ └── example.jsp // <- recompile is not triggerd even after this is updated
└── WEB-INF
└── web.xml
Of course, we can easily notice that the forwarded path is not canonicalized and not correct with the above simple example.
However, it's sometimes not easy to notice. For example, if the customer's application is Sping Boot based application and their controller has the following controller:
import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class DemoJspController { @RequestMapping("/test1") public String test1() { return "test/example"; // OK } @RequestMapping("/test2") public String test2() { return "/test/example"; // recompile is not triggered even after WEB-INF/jsp/test/example.jsp is updated } }
with JSP support:
spring.mvc.view.prefix:/WEB-INF/jsp/ spring.mvc.view.suffix:.jsp
The above "/test1" and "/test2" forward to the same "WEB-INF/jsp/test/example.jsp", but recompile is not triggered eve after example.jsp is updated in the latter one.
- clones
-
UNDERTOW-1873 Path is not canonicalized when Request.getRequestDispatcher() forwards to path that begins with "/"
- Resolved
- is cloned by
-
JBEAP-21383 [GSS](7.3.z) UNDERTOW-1873 - JSP file does not recompile when forwarding a request path is not canonicalized in exploded deployment
- Closed
- is incorporated by
-
JBEAP-21270 [GSS] (7.4.z) Upgrade undertow from 2.2.5.Final-redhat-00001 to 2.2.9.Final-redhat-00001
- Closed