Writing a custom ActionMapper is the way to go - it maps the URL to an action configuration and back again. I would write one for the "http://mysearchsite.com/XYZ+ABC"; pattern, and then use the Restful2ActionMapper for the "http://myseachsite.com/images/1"; pattern. The CompositeActionMapper will allow you to combine both these together in your application.

/Ian

Brian Pontarelli wrote:
This is very rails like. This is a tough one because of the way that Struts handles the URL to find the action mapping. If you want to support the Rails ID concept inside your URLs, I would suggest writing a custom filter to change the URL as it comes in based on some pre-defined criteria.

You could also try implementing a different action mapper (although I've never done that, so I'm not certain how difficult it would be).

You might also be able to leverage wild-card mappings to get what you need.

-bp


rakeshxp wrote:
Hello Everyone,

I am trying to figure out on how to implement custom URL format in Struts 2.

Specifically, I needed URLs like -> http://mysearchsite.com/XYZ+ABC => This should be calling a default
Action class and pass XYZ , ABC as parameters

-> http://myseachsite.com/images/1 => This should be calling an Image Action
class with 1 as a parameter
Has anyone achieved the above mentioned requirements before or can help me
do so ?
thanks in advance


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to