maybe my previous post was confusing. I have an HTML file with links to the following locations:
/apps/Apple
/apps/Orange
/apps/Berry
those locations exist in WebContent of my WAR...ie:
WebContent/Apple/index.jsp
WebContent/Orange/index.jsp
WebContent/Berry/index.jsp
I would like all those index.jsp pages to redirect to the following Actions, respectively...
Apple.do
Orange.do
Berry.do
my first question is: are the above actions declared as action mappings in the default config file, or in struts-apple.xml, strut-orange.xml and strut-berry.xml? (note, all my config files are in WEB-INF)
Now, I would like the above mentioned action mappings to be strut's ForwardActions which will forward the user to a JSP page behind WEB-INF using (I think) a syntax like so:
<action
path="/Apple.do"
type="org.apache.struts.actions.ForwardAction"
parameter="WEB-INF/Apple/firstPage.jsp"/>
<action
path="/Orange.do"
type="org.apache.struts.actions.ForwardAction"
parameter="WEB-INF/Orange/firstPage.jsp"/>
<action
path="/Berry.do"
type="org.apache.struts.actions.ForwardAction"
parameter="WEB-INF/Berry/firstPage.jsp"/>
If I understand everything I've read...
the user can browse to
"http://server/apps/Apple"
and his URL will then change to
"http://server/apps/Apple/Apple.do"
and he'll be looking at the contents of:
"WEB-INF/Apple/firstPage.jsp"
Right now, I'm getting a 404:
"Error 404: /Apple/WEB-INF/Apple/firstPage.jsp"
as I mentioned in the previous post, I think the controller is hosing me by adding the module ("/Apple") to the front of the parameter value listed in the action.
reading the following at
http://www.javaworld.com/javaworld/jw-09-2004/jw-0913-struts-p3.html snip....
struts-config.xml(s) has a controller tag; add a property in this tag named forwardPattern. This property's value can be prefixed to all the ActionForward paths. This property's default value is $M$P, which means the module prefix will be prefixed to ActionForward's path. We can change this value to anything; e.g., WEB-INF/pages/$M$P. As a result, all the ActionForward paths will be searched in the directory WEB-INF/pages/<module-prefix>/.
....snip
leads me to believe I need to change the forwardPattern from its default of $M$P to "WEB-INF/$M".
Is what I'm trying to do _that_ out of the ordinary?
On a side note, I find it strange that every single "best practice" article I've read has listed using modules and hiding your JSPs behind WEB-INF but I couldn't find a single example of doing both anywhere online. Every example uses either one or the other....
thanks!
Jason (AIM: skydive814)