You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Akins <an...@gmail.com> on 2010/12/10 04:56:11 UTC

Bad Struts Day

Not sure what is best here.

I need to create an URL with a value from my default resource bundle in the URL

For example <s:text name="IMAGE"/> returns logo.gif

I need to do something like <s:url value="/%{IMAGE}" /> that will
return my relative url with the value of IMAGE appended.

So if I'm at /App/11/index.jsp my img src will be /App/11/logo.gif

If I simply do <s:url value="/"/><s:text name="IMAGE"/> oftentimes the
jsessionid value get's placed on the end of the url and corrupts the
intended results.

Using struts 2.2.1 .. any suggestions?

-- 
Greg Akins

http://insomnia-consulting.org
http://www.pghcodingdojo.org
http://pittjug.dev.java.net
http://twitter.com/akinsgre
http://www.linkedin.com/in/akinsgre

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


Re: Bad Struts Day

Posted by Li Ying <li...@gmail.com>.
Try:

<s:url value="'/' + getText('IMAGE')" />

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


Re: Bad Struts Day

Posted by Maurizio Cucchiara <ma...@gmail.com>.
What about

<s:url value="%{#request.contextPath}/%{IMAGE}" id="url"/>

2010/12/10 Greg Akins <an...@gmail.com>:
> Not sure what is best here.
>
> I need to create an URL with a value from my default resource bundle in the URL
>
> For example <s:text name="IMAGE"/> returns logo.gif
>
> I need to do something like <s:url value="/%{IMAGE}" /> that will
> return my relative url with the value of IMAGE appended.
>
> So if I'm at /App/11/index.jsp my img src will be /App/11/logo.gif
>
> If I simply do <s:url value="/"/><s:text name="IMAGE"/> oftentimes the
> jsessionid value get's placed on the end of the url and corrupts the
> intended results.
>
> Using struts 2.2.1 .. any suggestions?
>
> --
> Greg Akins
>
> http://insomnia-consulting.org
> http://www.pghcodingdojo.org
> http://pittjug.dev.java.net
> http://twitter.com/akinsgre
> http://www.linkedin.com/in/akinsgre
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

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