You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by purulu agada <pu...@hotmail.com> on 2003/11/25 16:29:18 UTC

Jelly servlet revision proposition

Hi everybody

I needed to change the jelly servlet to fit my needs and i think that the 
servlet doesn't offer that much when you are willing to map for example 
*.jelly files to servlet : org.apache.commons.jelly.JellyServlet.

Here is my proposition for a revision of the function getScript, using 
getServletPath instead of getPathInfo()


	protected URL getScript(HttpServletRequest req)
		throws MalformedURLException {

		String scriptUrl = req.getParameter("script");
		if (scriptUrl == null) {
			// original
                        scriptUrl = req.getPathInfo();
			ScriptUrl = req.getServletPath();
		}
		URL url = getServletContext().getResource(scriptUrl);
        if (url == null) {
            throw new IllegalArgumentException("Invalid script url:" + 
scriptUrl);
        }
        return url;
	}

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org