struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterv <pe...@earth-photography.com>
Subject Multiple actions with overlapping URL ranges
Date Sat, 11 Aug 2007 17:35:17 GMT

Hi,

Is there a way in Struts 2 to make the action mapper choose the Action to be
invoked based on two criteria:
1) the action's name (eg. a wildcard mapping), and
2) a boolean value obtained by invoking a method in the action?

Why I need this: I want to create friendly URLs for several types of
resources (each having its own Action), for example:
http://books.com/AuthorName/BookTitle
http://books.com/Location/BranchName
...

The names of these resources are unique across all resource types, so I
don't want to define a unique URL prefix (eg. "/books" as in
"http://books.com/books/AuthorName/BookTitle") for each type - instead I
want to define actions that can determine for themselves if they can handle
the given URL (eg. if there's a book with the title entered), and if not,
the action mapper should move on to the next action. This would mean some
extra overhead, but result in the required URLs (we're migrating an already
operating site to Struts 2 and don't want to change the URL structure).

Is there a way to do this? Or maybe another approach that lets action URL
ranges overlap?

Thanks,
Peter

-- 
View this message in context: http://www.nabble.com/Multiple-actions-with-overlapping-URL-ranges-tf4254169.html#a12107451
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message