Martin raises some interesting issues in this enhancement request that I'd like to discuss a little before we figure out what to do.
The simplest issue is a design faux pas in the original struts-config setup -- the "input" parameter really should have been the name of a corresponding forward, so that we could auto-calculate the actual URL more gracefully. We can't change the past, but it wouldn't be hard to add an additional "forward" attribute as an alternative to "input", that works this way. What do you think? 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 On 1 Jul 2002 [EMAIL PROTECTED] wrote: > Date: 1 Jul 2002 18:10:02 -0000 > From: [EMAIL PROTECTED] > Reply-To: Struts Developers List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: DO NOT REPLY [Bug 10268] - Sub-apps need context-relative > option for 'input' of an Action > > DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG > RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT > <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10268>. > ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND > INSERTED IN THE BUG DATABASE. > > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10268 > > Sub-apps need context-relative option for 'input' of an Action > > > > > > ------- Additional Comments From [EMAIL PROTECTED] 2002-07-01 18:10 ------- > The problem is, my JSP pages are under WEB-INF, and the computed URL messes up > the path to that directory. If my action config looks like this: > > <action ... input='/WEB-INF/pages/myPage.jsp' ... /> > > then the computed URL looks like this: > > /myApp/mySubApp/WEB-INF/pages/myPage.jsp > > which is incorrect - the sub-app name should not be there. It needs to be: > > /myApp/WEB-INF/pages/myPage.jsp > > to work correctly. > > There was also a thread on struts-user a while ago where someone else was > having a similar problem: > > http://marc.theaimsgroup.com/?l=struts-user&m=101865931500963&w=2 > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
