struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike La Budde <mike.labu...@irista.com>
Subject Re: struts-config.xml problem/question (please help!)
Date Thu, 05 Oct 2000 13:34:41 GMT
Craig:

Thanks for your response. Sorry I wasn't clear in my original message. The 
context is called "mycontext" and the pages subdirectory contains several 
subdirectories (inventory, orders, etc.). Further, in my action mapping 
config file the third example was missing the "/pages/inventory/" prior to 
"InventoryActionViewPage".

So, am I going to have to specify full context-relative paths for all 
action paths as well as forward paths? How will this affect links specified 
within pages (be they to an Action or to a straight html page)? Obviously, 
from the discussion you & Colin had yesterday (geez, I can't take one day 
off without missing something!) this also will have a large impact on 
security constraints.

Thanks in advance for your insight,

Mike

PS: I'm sure that I used to have relative paths working just fine - I'll 
have to review the code prior to implementing struts.


At 10/03/2000 03:32 PM -0700, Craig R. McClanahan wrote:
>Mike La Budde wrote:
>
> > I''m in the process of converting from a home-grown Model-2 architecture to
> > the struts framework. In my ActionServlet config file I used to just
> > specify the name of the PATH and the FORWARD without having to fully
> > qualify either relative to the context's root directory.
> >
> > For example, here's the directory structure (starting at
> > ../webapps/mycontext/) :
> >
> > - pages
> > |
> > - - - - - - /inventory
> > |
> > - - - - - - /orders
> >
> > And here's a snippet from my new config file:
> >
> >     <!-- Inventory Actions -->
> >     <action path="/pages/inventory/InventoryActionSearchPage"
> >             type="com.xyz.inventory.InventoryActionSearchPage">
> >         <forward
> > name="success"             path="/pages/inventory/inventorySearch.jsp"/>
> >     </action>
> >
> >     <action path="/pages/inventory/InventoryActionListPage"
> >             type="com.xyz.inventory.InventoryActionListPage">
> >         <forward
> > name="success"             path="/pages/inventory/inventoryList.jsp"/>
> >     </action>
> >
> >     <action path="InventoryActionViewPage"
> >             type="com.xyz.inventory.InventoryActionViewPage">
> >         <forward
> > name="success"             path="/pages/inventory/inventoryRow.jsp"/>
> >     </action>
> >
> > My question is: Why do I have to specify full path locations to everything?
> > How are others doing this? Of course, keeping everything in the context's
> > root would eliminate this problem (while creating a new one)....
> >
>
>If "/pages" is the context path for your web application, you do *not*
>want to
>include it in the paths inside action.xml.  The paths here are all
>context-relative (in other words, they conform to the same requirements
>as the
>argument to ServletContext.getRequestDispatcher()).
>
>So, for example, the last example in your new file should read:
>
>     <action path="InventoryActionViewPage"
>       type="com.xyz.inventory.InventoryActionViewPage">
>         <forward name="success" path="/inventory/inventoryRow.jsp"/>
>     </action>
>
> >
> > TIA,
> >
> > Mike
>
>Craig
>
>====================
>See you at ApacheCon Europe <http://www.apachecon.com>!
>Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
>Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
>                                     Applications to Tomcat


Mime
View raw message