You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alan Treece <aj...@sun.com> on 2006/04/22 00:00:21 UTC
Modularized app and hiding JSPs
Maybe this is simple, but then again may it's not... I've got a
Struts app that I'm breaking up onto modules so that I can keep the
configs seperate. The JSP files are already seperated out into
different directories, but what I want to do is hide all of them in
the WEB-INF directory. I know that I need to add WEB-INF that to the
path so that the framework can find the JSP's, but this doesn't seem
to play well with the modules..
If I activate an action in one of the modules... like /search/
startsearch.do then the framework looks for the jsp in /search/WEB-
INF/jsp/... I can do a hack and create a search directory and then
link /search/WEB-INF back to the "real" WEB-INF directory, but I'd
rather not. Am I missing a configuration option that will eliminate
this problem?
Thanks, ajTreece
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Modularized app and hiding JSPs
Posted by Ted Husted <te...@gmail.com>.
Yes, it's easy. The configuration point you need is pagePattern
* http://struts.apache.org/struts-action/userGuide/configuration.html
You would probably want to use something like
<controller pagePattern="/WEB-INF/jsp/$M$P" />
so that the locations resolve to /WEB-INF/jsp/search/search.do
-Ted.
On 4/21/06, Alan Treece <aj...@sun.com> wrote:
> Maybe this is simple, but then again may it's not... I've got a
> Struts app that I'm breaking up onto modules so that I can keep the
> configs seperate. The JSP files are already seperated out into
> different directories, but what I want to do is hide all of them in
> the WEB-INF directory. I know that I need to add WEB-INF that to the
> path so that the framework can find the JSP's, but this doesn't seem
> to play well with the modules..
>
> If I activate an action in one of the modules... like /search/
> startsearch.do then the framework looks for the jsp in /search/WEB-
> INF/jsp/... I can do a hack and create a search directory and then
> link /search/WEB-INF back to the "real" WEB-INF directory, but I'd
> rather not. Am I missing a configuration option that will eliminate
> this problem?
>
>
> Thanks, ajTreece
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Modularized app and hiding JSPs
Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Alan, did you know that you can have multiple config files without
resorting to modules? I ask because I've found in my experience that
many times people use modules without knowing that, and make life more
difficult for themselves.
As for hiding JSPs in WEB-INF, if memory serves, they are only
inaccessible from external requests, i.e., I believe you can still
forward to them, just not redirect. So, make sure all requests go
through Struts (i.e., no JSP directly references another JSP), and I
believe you'll get what you want (hint: use ForwardAction for those JSPs
you would normally reference directly).
Frank
Alan Treece wrote:
> Maybe this is simple, but then again may it's not... I've got a Struts
> app that I'm breaking up onto modules so that I can keep the configs
> seperate. The JSP files are already seperated out into different
> directories, but what I want to do is hide all of them in the WEB-INF
> directory. I know that I need to add WEB-INF that to the path so that
> the framework can find the JSP's, but this doesn't seem to play well
> with the modules..
>
> If I activate an action in one of the modules... like
> /search/startsearch.do then the framework looks for the jsp in
> /search/WEB-INF/jsp/... I can do a hack and create a search directory
> and then link /search/WEB-INF back to the "real" WEB-INF directory, but
> I'd rather not. Am I missing a configuration option that will eliminate
> this problem?
>
>
> Thanks, ajTreece
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org