Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

How to use pattern matching wild-card in action names?

Binil Thomas

2008-10-09

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi all,

I am trying to make my URLs more readable, and was hoping that I could use
pattern-matching wildcards in action declarations. I have not been able to
get it working so far.

In my struts.xml, I have:
<struts>
  <constant name="struts.enable.SlashesInActionNames" value="true"/>
  <constant name="struts.action.extension" value="" />
  <package name="s2" extends="struts-default" namespace="/">
    <action name="widgets*" class="app.WidgetsAction" method="index">
       <result name="success">index.jsp</result>
    </action>
  </package>
</struts>

Now, /widgets get routed to be my action. /widgets1 also get routed to the
action as one would expect. But /widgets/1 does not get routed to my action.
Why is this so? I tried the pattern "widgets/*" also, but that does not work
either. I think I have not been able to coax Struts to have slashes in the
name of action. Any help is appreciated.

Thanks,
Binil
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 gg3721.com - Jax Systems, LLC, U.S.A.