struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Law <>
Subject Re: S2: possibly strange namespace use case
Date Wed, 30 Jul 2008 16:34:03 GMT

Jeromy Evans - Blue Sky Minds wrote:
> Andy Law wrote:
>> e.g.
>> /foo/Action1.action runs action1 passing in 'foo' and /bar/Action1.action
>> runs the same action passing in 'bar'.
>> How should I code/configure/build this kind of thing.
> In Struts 2.0.x, you may be able to use wildcards in the namespace 
> depending on how many variations you need.
> In Struts 2.0.x, you may also be able to use the RestfulActionMapper to 
> pass simple properties to your action through the path.
> Use it with a CompositeActionMapper.
> In Struts 2.1.x, use the NamedVariablePatternMatcher to pass parameters 
> through the namespace, as described in this thread:


That's enormously helpful - thanks.

A short follow-up. Can you point me towards a description of where/when the
Action object gets created and where Interceptors fit into the process.

I need to understand how I'm going to get the leading part of the URL into
the action object and my head really, really hurts right now... :o}. I'm
wondering if an interceptor might be a better, more understandable (to me)

If I'm reading things right as of now, the ActionMapper route will fire (and
complete) before the Action object is created (since the ActionMapper
decides *which* Action gets created) so my options there are to put the
details of what I find in the URL path into the request object where it can
be pulled by the Action (which makes testing slightly harder), whereas an
Interceptor allows me to just magic the details into the Action. On the
other hand, the Interceptor requires a signature on the Action which could
be overruled with a Parameter in the URL?

Please tell me if I'm talking nonsense. I'm just kind of thinking out loud
while I try to get a feel for the best way to do what I need.


Andy Law

View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message