You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ma...@ensam.eu on 2011/05/17 11:24:59 UTC
encodeBase64URLSafeString in s:param
Hi,
I have a problem calling a method in a s :param tag.
I want to encode an url parameter in base64 in order to avoid French special char and charset problem.
<s:url id="urlItem" action="display" namespace="%{nspace}" encode="true">
<s:param name="dn64" value="%{org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(item.result.common.dn.bytes)}" />
<s:param name="dn" value="#item.result.common.dn " />
</s:url>
The param 'dn' is working.
Item.result.common.dn.bytes is working (tested with a s:property tag).
But the method encodeBase64UrlSafeString is not called (I put a breakpoint in the method).
Is it possible to call a static method from an external package ? if yes, what is the correct syntax ?
Cordialy,
Matthieu MARC
---
Matthieu MARC
Responsable du Service Informatique du Centre d'Angers
Arts et Métiers ParisTech
Tél : 02 41 20 73 61
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: encodeBase64URLSafeString in s:param
Posted by Andrew Lee <pl...@gmail.com>.
You can do that using "@com.xxx.xxx.classname@methodname(arg)" but wouldn't
it be better to expose another getter on your action which provided the
encoded string.
Would be easier to test.
On 17 May 2011 10:25, <Ma...@ensam.eu> wrote:
> Hi,
>
> I have a problem calling a method in a s :param tag.
>
> I want to encode an url parameter in base64 in order to avoid French
special char and charset problem.
>
> <s:url id="urlItem" action="display" namespace="%{nspace}" encode="true">
> <s:param name="dn64"
value="%{org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(item.result.common.dn.bytes)}"
/>
> <s:param name="dn" value="#item.result.common.dn " />
> </s:url>
>
> The param 'dn' is working.
> Item.result.common.dn.bytes is working (tested with a s:property tag).
> But the method encodeBase64UrlSafeString is not called (I put a breakpoint
in the method).
>
> Is it possible to call a static method from an external package ? if yes,
what is the correct syntax ?
>
> Cordialy,
>
> Matthieu MARC
>
>
> ---
> Matthieu MARC
> Responsable du Service Informatique du Centre d'Angers
> Arts et Métiers ParisTech
> Tél : 02 41 20 73 61
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>