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. > > http://struts.apache.org/2.0.11.2/docs/wildcard-mappings.html > > In Struts 2.0.x, you may also be able to use the RestfulActionMapper to > pass simple properties to your action through the path. > > http://struts.apache.org/2.0.11.2/docs/restfulactionmapper.html > > Use it with a CompositeActionMapper. > > In Struts 2.1.x, use the NamedVariablePatternMatcher to pass parameters > through the namespace, as described in this thread: > http://www.nabble.com/REST-plugin-URL-syntax-td17855192i20.html >
Jeromy, 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) option? 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. Later, Andy Law -- View this message in context: http://www.nabble.com/S2%3A-possibly-strange-namespace-use-case-tp18694697p18737366.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]