struts-user mailing list archives

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


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:

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
"") 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?


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