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
Author

/* in Struts Action Mapping

Reshma Sreenivasulu
Greenhorn

Joined: Dec 08, 2005
Posts: 8
Hi,

I have the following action mappings.

Say,

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

and

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

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.


Reshma
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.


Merrill
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