jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Consider Paul's rocket mass heater.
 
subject: /* in Struts Action Mapping
 
Similar Threads
Struts Cancel Button submits the form
Passing a parm to a DispatchAction without a form?
How to encode the path attribute in action mapping
Doubt regarding action class
Some problem with local Forward