Meaningless Drivel is fun!*
The moose likes Struts and the fly likes /* in Struts Action Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "/* in Struts Action Mapping" Watch "/* in Struts Action Mapping" New topic

/* in Struts Action Mapping

Reshma Sreenivasulu

Joined: Dec 08, 2005
Posts: 8

I have the following action mappings.


<action path="/a" type="AAction">
<forward name="success" path="success.jsp" />
<forward name="failure" path="error.jsp" />


<action path="/b" type="BAction">
<forward name="success" path="success.jsp" />
<forward name="failure" path="error.jsp" />

And I have a requirement which is like this.

when the 'path' is anything OTHER THAN "/a" or "/b", i want it to be directed to a specific Action class.

I tried the path="/*", but its not supported.

How can this be implemented?

Thanks in advance.

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I'm afraid you can't specify a default mapping that is used if none of the others match.

Refer to the heading "Using Wildcards in ActionMappings" in this link to see what you can do.

Consultant, Sima Solutions
subject: /* in Struts Action Mapping
Similar Threads
Some problem with local Forward
Doubt regarding action class
Struts Cancel Button submits the form
Passing a parm to a DispatchAction without a form?
How to encode the path attribute in action mapping