You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Giovanni Azua <gi...@imc.nl> on 2008/02/05 18:17:35 UTC

dispaytag + Struts 2.1.x: encoding parameters into requestURI

hi,

I require encoding get parameters into the requestURI field but I can't 
find the way e.g.

<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net/el" %>

<display:table name="statistics" id="statistics" defaultorder="descending"
  requestURI="/SimulationReport.action?simulationKey=&"
  export="false" sort="list" 
decorator="com.sag.optimizer.ui.web.displaytag.decorator.StatisticDecorator">
      <display:column property="name" title="Statistic" />
      <display:column property="value" title="Value" 
format="{0,number,0.00}" sortable="true" style="text-align: right;" 
headerClass="sortable" />
      <display:caption style="font-weight: bold; font-size: 
120%;">Statistics</display:caption>               
 </display:table>

Assuming I make available a parameter "simulationKey":

<% String mySimulationKey = 
request.getAttribute("simulationKey").toString(); %>

<display:table name="statistics" id="statistics" defaultorder="descending"
  requestURI="/SimulationReport.action?simulationKey=<%=mySimulationKey%>&"
...

or

<s:url var="simulationReport" includeParams="get" 
value="/SimulationReport.action" >
     <s:param name="simulationKey" value="%{simulationKey}" />   
</s:url>

<display:table name="statistics" id="statistics" defaultorder="descending"
  requestURI="%{#simulationReport}"
...

I have also tried calling a javascript function and encoding it there 
but does not work either :(

Any advice?

regards,
Giovanni




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


Re: dispaytag + Struts 2.1.x: encoding parameters into requestURI

Posted by Giovanni Azua <gi...@imc.nl>.
hi Randy,

You're right! many thanks!

Best regards,
Giovanni

Randy Burgess wrote:
> All you should need is a getter in your action for simulationKey and then
>
>   
>> <display:table name="statistics" id="statistics" defaultorder="descending"
>>   requestURI="/SimulationReport.action?simulationKey=${simulationKey}"
>>     
>  
>
> Regards,
> Randy Burgess
> Sr. Web Applications Developer
> Nuvox Communications
>   


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


Re: dispaytag + Struts 2.1.x: encoding parameters into requestURI

Posted by Randy Burgess <RB...@nuvox.com>.
All you should need is a getter in your action for simulationKey and then

> <display:table name="statistics" id="statistics" defaultorder="descending"
>   requestURI="/SimulationReport.action?simulationKey=${simulationKey}"
 

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Giovanni Azua <gi...@imc.nl>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Tue, 05 Feb 2008 18:17:35 +0100
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: dispaytag + Struts 2.1.x: encoding parameters into requestURI
> 
> hi,
> 
> I require encoding get parameters into the requestURI field but I can't
> find the way e.g.
> 
> <%@ page contentType="text/html; charset=UTF-8"%>
> <%@ taglib prefix="s" uri="/struts-tags"%>
> <%@ taglib prefix="display" uri="http://displaytag.sf.net/el" %>
> 
> <display:table name="statistics" id="statistics" defaultorder="descending"
>   requestURI="/SimulationReport.action?simulationKey=&"
>   export="false" sort="list"
> decorator="com.sag.optimizer.ui.web.displaytag.decorator.StatisticDecorator">
>       <display:column property="name" title="Statistic" />
>       <display:column property="value" title="Value"
> format="{0,number,0.00}" sortable="true" style="text-align: right;"
> headerClass="sortable" />
>       <display:caption style="font-weight: bold; font-size:
> 120%;">Statistics</display:caption>
>  </display:table>
> 
> Assuming I make available a parameter "simulationKey":
> 
> <% String mySimulationKey =
> request.getAttribute("simulationKey").toString(); %>
> 
> <display:table name="statistics" id="statistics" defaultorder="descending"
>   requestURI="/SimulationReport.action?simulationKey=<%=mySimulationKey%>&"
> ...
> 
> or
> 
> <s:url var="simulationReport" includeParams="get"
> value="/SimulationReport.action" >
>      <s:param name="simulationKey" value="%{simulationKey}" />
> </s:url>
> 
> <display:table name="statistics" id="statistics" defaultorder="descending"
>   requestURI="%{#simulationReport}"
> ...
> 
> I have also tried calling a javascript function and encoding it there
> but does not work either :(
> 
> Any advice?
> 
> regards,
> Giovanni
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

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