DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32720>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32720

           Summary: in JellyServlet, the procedure used to determine the
                    script's URL is too simplistic.
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jelly
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Suggestion for replacing the getScript method (based on the process used by
Freemarker); this covers many more cases...:

protected URL getScript(HttpServletRequest req)
                        throws MalformedURLException {
                String scriptUrl = null;
                
                String includedPath = (String)
req.getAttribute("javax.servlet.include.servlet_path");
                if (includedPath != null) { //This is the result of a 
RequestDispatcher include...
                        String includedPathInfo = (String)
req.getAttribute("javax.servlet.include.path_info");
                        if (includedPathInfo != null) {
                                scriptUrl = includedPathInfo;
                        } else {
                                scriptUrl = includedPath;
                        }
                } else {
                        scriptUrl = req.getParameter("script");
                        if (scriptUrl == null) {
                                scriptUrl = req.getPathInfo();
                        }
                        if (scriptUrl == null) {
                                scriptUrl = req.getServletPath();
                        }
                }
                
                URL url = getServletContext().getResource(scriptUrl);
                if (url == null) {
                        throw new IllegalArgumentException("Invalid script url:"
                                        + scriptUrl);
                }
                return url;
        }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to