You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kies, Daniel" <dk...@state.mt.us> on 2004/06/08 21:52:39 UTC

Putting Multiple Parameters in the Request

Question:

I am trying to put two parameters into the request, but with this code, only
the second parameter, offer, gets into the request.  

<html:link href="/ActionPath.do" 
	paramName="Bean" 
	paramProperty="studentName" 
	paramId="student" 
	paramProperty="offerID" 
	paramId="offer">Link</html:link>

If I take offer out and the code looks like this:

<html:link href="/ActionPath.do" 
	paramName="Bean" 
	paramProperty="studentName" 
	paramId="student">Link</html:link>

The request will get populated with the student data with no problem.  What
is the best way to handle throwing two or more variables in the request?

Thanks for any input,
Dan

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


Re: Putting Multiple Parameters in the Request

Posted by Henrique VIECILI <vi...@softplan.com.br>.
Hi Daniel,

from struts-doc at http://jakarta.apache.org/struts/userGuide/struts-html.html#link

"Normally, the hyperlink you specify with one of the attributes described in the previous paragraph will be left unchanged (other than URL rewriting if necessary). However, there are two ways you can append one or more dynamically defined query parameters to the hyperlink -- specify a single parameter with the paramId attribute (and its associated attributes to select the value), or specify the name (and optional property) attributes to select a java.util.Map bean that contains one or more parameter ids and corresponding values."

At struts-doc you will find out how to do this.


Henrique Viecili
  ----- Original Message ----- 
  From: Kies, Daniel 
  To: 'user@struts.apache.org' 
  Sent: Tuesday, June 08, 2004 4:52 PM
  Subject: Putting Multiple Parameters in the Request


  Question:

  I am trying to put two parameters into the request, but with this code, only
  the second parameter, offer, gets into the request.  

  <html:link href="/ActionPath.do" 
  paramName="Bean" 
  paramProperty="studentName" 
  paramId="student" 
  paramProperty="offerID" 
  paramId="offer">Link</html:link>

  If I take offer out and the code looks like this:

  <html:link href="/ActionPath.do" 
  paramName="Bean" 
  paramProperty="studentName" 
  paramId="student">Link</html:link>

  The request will get populated with the student data with no problem.  What
  is the best way to handle throwing two or more variables in the request?

  Thanks for any input,
  Dan

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