This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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
I agree. Here's the link:
subject: /* in Struts Action Mapping
It's not a secret anymore!