File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Actions (struts) dynamic path forwarding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Actions (struts) dynamic path forwarding" Watch "Actions (struts) dynamic path forwarding" New topic

Actions (struts) dynamic path forwarding

Jochen Maes

Joined: Dec 03, 2002
Posts: 20
Hi all,

my mappings are like this:
[code]<action path="/order" type="OrderAction">
<forward name="orders" path="/orders/orders.jsp"/>
<forward name="detail" path="/orders/detail.jsp"/>
<forward name="form" path="/orders/placeorder.jsp"/>
<forward name="emptyform" path="/orders/placeorder.jsp?empty=true"/>
<forward name="place" path="/orders/confirm.jsp?response=ok"/>
<forward name="cancelled" path="/orders/cancelled.jsp"/>[code]
as you see the paths are hard coded...
is there a possibility to add somepthing in front of the path dynamicly? like user1 has /user1/<actionpath> and user2 has /user2/<actionpath> ???
i have absolutely no clue how to acchieve this... please advice...
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Moving to the Struts forum. (They just CALL it the Frameworks forum ).

"JavaRanch, where the deer and the Certified play" - David O'Meara
ca buki

Joined: Oct 10, 2002
Posts: 12
You have to build it in the action handler. Try this:

[ April 30, 2003: Message edited by: Jon McLennan ]
I agree. Here's the link:
subject: Actions (struts) dynamic path forwarding
It's not a secret anymore!