struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Brown" <donald.br...@gmail.com>
Subject Re: [S2] Wildcard action name that includes slashes?
Date Mon, 03 Sep 2007 22:09:33 GMT
Use two astrisks - '**'

Don

On 9/4/07, Neil Aggarwal <neil@jammconsulting.com> wrote:
> Hello:
>
> In my struts.xml, I have this property:
>
>   <constant name="struts.enable.SlashesInActionNames" value="true"/>
>
> At the very end of my actions, I have this one:
>
>     <action name="*" class="page.NavUtil">
>       <result name="success" type="tiles">page.products</result>
>     </action>
>
> This works if I have a url with a non-slash action name:
> http://cbsweb.jammconsulting.com/cbsweb/nonExistent.action
> loads the page I want.
>
> But, if I have an action name with a slash in it:
> http://cbsweb.jammconsulting.com/cbsweb/test/nonExistent.action
> I get this error:
> [TP-Processor3] ERROR org.apache.struts2.dispatcher.Dispatcher  - Could not
> find action or result
> There is no Action mapped for action name test/nonExistent. - [unknown
> location]
>         at
> com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:1
> 86)
>
> But, if I add this action to my struts.xml:
>     <action name="*/*" class="page.NavUtil">
>       <result name="success" type="tiles">page.products</result>
>     </action>
> It brings up the correct page.
>
> Is there a way to have a wildcard that will match anything from
> the url even if there are slashes in it?
>
> Thanks,
>         Neil
>
> --
> Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com
> Eliminate junk email and reclaim your inbox.
> Visit http://www.spammilter.com for details.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message