struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <>
Subject Re: Subapps and /WEB-INF (was: Re: DO NOT REPLY [Bug 10268] - Sub-apps need context-relative option for 'input' of an Action)
Date Mon, 01 Jul 2002 20:47:25 GMT
"Craig R. McClanahan" wrote:
> The more important issue Martin raises is that the algorithm for
> sub-application mapping (context-relative prefix) doesn't play very nice
> with folks who want to put their JSP pages in the /WEB-INF subdirectory.
> One way to get around this would be to modify the algorithm for converting
> a subapp-relative path into an absolute path in RequestUtils.computeURL().
> Instead of always sticking the subapp prefix before the specified path,
> it would look at the subapp-relative path and, if it started with
> "/WEB-INF" and perform the appropriate surgery.  Thus, a forward to the
> subapp relative page "/WEB-INF/foo.jsp" in subapp "/mysubapp" would end up
> creating the URL:
>   /WEB-INF/mysubapp/foo.jsp
> instead of the current:
>   /mysubapp/WEB-INF/foo.jsp
> While this is sort of a kludge (and the whole algorithm is something that
> should be more easily pluggable in a post-1.1 design), it *is* backwards
> compatible with current usage without subapps (i.e. the path of a page for
> the default subapp is the same as it is now).
> What do you think about implementing both of these options (new "forward"
> option on <action>, and the calculation change)?  Together, I think they
> address what Martin is after, and deals with the more general problems of
> using subapps together with /WEB-INF.
> Craig

To get out of the kludge-zone, maybe we should consider this a specific
case of a more general feature request. The forward could have a prefix
attribute that would get inserted in front of any subapp. That way if
someone wanted to use some other root directory, like 


they could do that too. (Or /WEB-INF/pages/mysubapp/foo.jsp, if they
wanted to use a longer prefix. 

-- Ted Husted, Husted dot Com, Fairport NY US
-- Java Web Development with Struts
-- Tel: +1 585 737-3463
-- Web:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message