You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thilo Ettelt <te...@carmunity.de> on 2007/11/09 14:55:08 UTC

[S.2.1] Wildcard Mappings + Struts s:url tag

Hello,

I'm new to this list. I've learned a lot from the Confluence, but I 
couldn't figure out how to reassemble an wildcard action mapping using 
the s:url.
I figured that when there is an wildcard action and it can put parts of 
the request uri into my action bean or result string, then how can I put 
my attributes into an action URL using s:url tag?

This didn't work:

<s:url action="calendar/work/*/*/view" id="myShinyURL">
   <s:param name="page" value="1"/>
   <s:param name="time" value="month"/>
</s:url>

It just append two parameters. Isn't there a way to somehow "reverse" 
creating a wildcard mapped URL, meaning Struts assembles the right URL 
using the Wildcard settings and not regular parameters?

Thx in advance.


- Thilo

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


Re: [S.2.1] Wildcard Mappings + Struts s:url tag

Posted by Thilo Ettelt <te...@carmunity.de>.
Ok, how embarassing. Struts 1 got me trapped in this one, thus I 
considered that I'd have to pass the same action name as specified in 
the action mappings. Which is stupid of me because now it's Struts 2  
and now it's Wildcards. ;)

Using: <s:url action="calendar/work/%{var1}/%{var2}/view" id="myShinyURL"/>
solved my problem easily...


- Thilo

Thilo Ettelt wrote:
> Hello,
>
> I'm new to this list. I've learned a lot from the Confluence, but I 
> couldn't figure out how to reassemble an wildcard action mapping using 
> the s:url.
> I figured that when there is an wildcard action and it can put parts 
> of the request uri into my action bean or result string, then how can 
> I put my attributes into an action URL using s:url tag?
>
> This didn't work:
>
> <s:url action="calendar/work/*/*/view" id="myShinyURL">
>   <s:param name="page" value="1"/>
>   <s:param name="time" value="month"/>
> </s:url>
>
> It just append two parameters. Isn't there a way to somehow "reverse" 
> creating a wildcard mapped URL, meaning Struts assembles the right URL 
> using the Wildcard settings and not regular parameters?
>
> Thx in advance.
>
>
> - Thilo
>
> ---------------------------------------------------------------------
> 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