To answer my own question - wildcards do not seem to work if the namespace is
"/". I tried adding a namespace and it works. Can someone explain why this
is so?

<struts> 
    <constant name="struts.enable.SlashesInActionNames" value="true"/>
    <constant name="struts.action.extension" value=""/>
    
    <package name="default" extends="struts-default" namespace="/w">
        <action name="widgets/*" class="app.WidgetsAction">
            {1}
            <result name="success">/index.jsp</result>
        </action>
    </package>
</struts>

Thanks,
Binil


Binil Thomas wrote:
> 
> 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
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-use-pattern-matching-wild-card-in-action-names--tp19910768p19912812.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to