struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Almeida <mig...@almeida.at>
Subject Re: S:url and s:param and character encoding
Date Mon, 01 Sep 2014 11:17:17 GMT


On Mon, 2014-09-01 at 10:20 +0200, Lukasz Lenart wrote:

> 2014-08-29 18:11 GMT+02:00 Miguel Almeida <miguel@almeida.at>:
> > I had an issue recently with a download action not finding the
> > corresponding file and you might be able to help me with it. The
> > filename (on disk) was "Calendário" ("á" is the focus here).
> >
> > I am using the following s:url (Calendário is within the variable
> > #answer):
> >
> >                                 <s:url encode="true" var="downloadUrl" action="Filedownload">
> >                                         <s:param name="answer.id">${entityId}</s:param>
> >                                         <s:param name="fileName"><s:property
value="%{#answer}"/></s:param>
> >                                 </s:url>
> >                                 <s:a theme="simple" href="%{downloadUrl}"><s:property
> > value="%{#answer}"/></s:a>
> 
> It can be an issue in DefaultUrlHelper as it uses
> paramValue.toString() (which means it uses server's locale), did you
> try to use <s:param name="fileName">${answer}</s:param> instead of
> <s:param name="fileName"><s:property value="%{#answer}"/></s:param>
?

I actually had <s:param name="fileName">${answer}</s:param> and it
worked corretly. I had to change to the <s:property> alternative due to
an issue with a JSP page with a grouped view - somewhere in the code the
variable #answer is probably being set differently, so with ${answer} I
would get an array [id1,id2...] whereas with <s:property
value="%{#answer}"/> I would get the correct fileName.



> 
> 
> Regards

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message