You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Otávio Augusto <ot...@bol.com.br> on 2003/12/24 16:59:58 UTC

parameters in a link

Hi all

I'm trying to add a parameter (yeah,i mean only one) to a link. actually, it is an logic:iterator tag which generates a table, and one of the columns is the link to an action which is going to get the parameter send throw the request, process it and go to a jsp. so, the code follows:

<logic:iterate id="setor" name="setores">
  <tr>
    <td><bean:write name="setor" property="nome" /></td>
    <td><bean:write name="setor" property="comentario" /></td>
	<bean:define id="idSetor" name="setor" property="id" />
	<td><html:link action="setoradmin" paramProperty="idSetor" paramName="setor">Detalhes</html:link></td>
  </tr>
</logic:iterate>

I correctly generate de table and its values, but i can't generate the parameter i need to add to the link. Of course, this code might be wrong.
Any sugestions?

thanks, and happy holydays.

Otávio augusto

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


Re: parameters in a link

Posted by Otávio Augusto <ot...@bol.com.br>.
Thanks Brice. Works fine now, and it makes all sense.

Otávio Augusto

On Wed, 24 Dec 2003 10:27:46 -0600
Brice Ruth <br...@fiskars.com> wrote:

> the paramId value of html:link will be the name of the parameter that 
> gets passed in the query string, the paramName attribute will be the 
> name of a bean that is used (toString) to generate the value of that 
> parameter. So, something like this:
> 
> <c:set var="myTopic" value="Struts"/>
> <html:link action="/myAction" paramId="topic" paramName="myTopic">my 
> link</html:link>
> 
> Should generate a link like so:
> 
> <a href="/myAction.do?topic=Struts">my link</a>
> 
> Make sense?
> 
> Otávio Augusto wrote:
> 
> >U mean i just need to add the paramId ?
> >
> >thanks 
> >Otávio Augusto
> >
> >On Wed, 24 Dec 2003 16:11:52 +0000
> >Mark Lowe <ma...@talk21.com> wrote:
> >
> >  
> >
> >>just need paramId to set the parameter name.
> >>
> >>
> >>On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
> >>
> >>    
> >>
> >>>Hi all
> >>>
> >>>I'm trying to add a parameter (yeah,i mean only one) to a link. 
> >>>actually, it is an logic:iterator tag which generates a table, and one 
> >>>of the columns is the link to an action which is going to get the 
> >>>parameter send throw the request, process it and go to a jsp. so, the 
> >>>code follows:
> >>>
> >>><logic:iterate id="setor" name="setores">
> >>>  <tr>
> >>>    <td><bean:write name="setor" property="nome" /></td>
> >>>    <td><bean:write name="setor" property="comentario" /></td>
> >>>	<bean:define id="idSetor" name="setor" property="id" />
> >>>	<td><html:link action="setoradmin" paramProperty="idSetor" 
> >>>paramName="setor">Detalhes</html:link></td>
> >>>  </tr>
> >>></logic:iterate>
> >>>
> >>>I correctly generate de table and its values, but i can't generate the 
> >>>parameter i need to add to the link. Of course, this code might be 
> >>>wrong.
> >>>Any sugestions?
> >>>
> >>>thanks, and happy holydays.
> >>>
> >>>Otávio augusto
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>>
> >>>      
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>    
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >  
> >
> 
> -- 
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: parameters in a link

Posted by Brice Ruth <br...@fiskars.com>.
the paramId value of html:link will be the name of the parameter that 
gets passed in the query string, the paramName attribute will be the 
name of a bean that is used (toString) to generate the value of that 
parameter. So, something like this:

<c:set var="myTopic" value="Struts"/>
<html:link action="/myAction" paramId="topic" paramName="myTopic">my 
link</html:link>

Should generate a link like so:

<a href="/myAction.do?topic=Struts">my link</a>

Make sense?

Otávio Augusto wrote:

>U mean i just need to add the paramId ?
>
>thanks 
>Otávio Augusto
>
>On Wed, 24 Dec 2003 16:11:52 +0000
>Mark Lowe <ma...@talk21.com> wrote:
>
>  
>
>>just need paramId to set the parameter name.
>>
>>
>>On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
>>
>>    
>>
>>>Hi all
>>>
>>>I'm trying to add a parameter (yeah,i mean only one) to a link. 
>>>actually, it is an logic:iterator tag which generates a table, and one 
>>>of the columns is the link to an action which is going to get the 
>>>parameter send throw the request, process it and go to a jsp. so, the 
>>>code follows:
>>>
>>><logic:iterate id="setor" name="setores">
>>>  <tr>
>>>    <td><bean:write name="setor" property="nome" /></td>
>>>    <td><bean:write name="setor" property="comentario" /></td>
>>>	<bean:define id="idSetor" name="setor" property="id" />
>>>	<td><html:link action="setoradmin" paramProperty="idSetor" 
>>>paramName="setor">Detalhes</html:link></td>
>>>  </tr>
>>></logic:iterate>
>>>
>>>I correctly generate de table and its values, but i can't generate the 
>>>parameter i need to add to the link. Of course, this code might be 
>>>wrong.
>>>Any sugestions?
>>>
>>>thanks, and happy holydays.
>>>
>>>Otávio augusto
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: parameters in a link

Posted by Brice Ruth <br...@fiskars.com>.
Oh, and check here:

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

All the info you should ever need :)

Otávio Augusto wrote:

>U mean i just need to add the paramId ?
>
>thanks 
>Otávio Augusto
>
>On Wed, 24 Dec 2003 16:11:52 +0000
>Mark Lowe <ma...@talk21.com> wrote:
>
>  
>
>>just need paramId to set the parameter name.
>>
>>
>>On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
>>
>>    
>>
>>>Hi all
>>>
>>>I'm trying to add a parameter (yeah,i mean only one) to a link. 
>>>actually, it is an logic:iterator tag which generates a table, and one 
>>>of the columns is the link to an action which is going to get the 
>>>parameter send throw the request, process it and go to a jsp. so, the 
>>>code follows:
>>>
>>><logic:iterate id="setor" name="setores">
>>>  <tr>
>>>    <td><bean:write name="setor" property="nome" /></td>
>>>    <td><bean:write name="setor" property="comentario" /></td>
>>>	<bean:define id="idSetor" name="setor" property="id" />
>>>	<td><html:link action="setoradmin" paramProperty="idSetor" 
>>>paramName="setor">Detalhes</html:link></td>
>>>  </tr>
>>></logic:iterate>
>>>
>>>I correctly generate de table and its values, but i can't generate the 
>>>parameter i need to add to the link. Of course, this code might be 
>>>wrong.
>>>Any sugestions?
>>>
>>>thanks, and happy holydays.
>>>
>>>Otávio augusto
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.


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


Re: parameters in a link

Posted by Otávio Augusto <ot...@bol.com.br>.
U mean i just need to add the paramId ?

thanks 
Otávio Augusto

On Wed, 24 Dec 2003 16:11:52 +0000
Mark Lowe <ma...@talk21.com> wrote:

> just need paramId to set the parameter name.
> 
> 
> On 24 Dec 2003, at 15:59, Otávio Augusto wrote:
> 
> > Hi all
> >
> > I'm trying to add a parameter (yeah,i mean only one) to a link. 
> > actually, it is an logic:iterator tag which generates a table, and one 
> > of the columns is the link to an action which is going to get the 
> > parameter send throw the request, process it and go to a jsp. so, the 
> > code follows:
> >
> > <logic:iterate id="setor" name="setores">
> >   <tr>
> >     <td><bean:write name="setor" property="nome" /></td>
> >     <td><bean:write name="setor" property="comentario" /></td>
> > 	<bean:define id="idSetor" name="setor" property="id" />
> > 	<td><html:link action="setoradmin" paramProperty="idSetor" 
> > paramName="setor">Detalhes</html:link></td>
> >   </tr>
> > </logic:iterate>
> >
> > I correctly generate de table and its values, but i can't generate the 
> > parameter i need to add to the link. Of course, this code might be 
> > wrong.
> > Any sugestions?
> >
> > thanks, and happy holydays.
> >
> > Otávio augusto
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Re: parameters in a link

Posted by Mark Lowe <ma...@talk21.com>.
just need paramId to set the parameter name.


On 24 Dec 2003, at 15:59, Otávio Augusto wrote:

> Hi all
>
> I'm trying to add a parameter (yeah,i mean only one) to a link. 
> actually, it is an logic:iterator tag which generates a table, and one 
> of the columns is the link to an action which is going to get the 
> parameter send throw the request, process it and go to a jsp. so, the 
> code follows:
>
> <logic:iterate id="setor" name="setores">
>   <tr>
>     <td><bean:write name="setor" property="nome" /></td>
>     <td><bean:write name="setor" property="comentario" /></td>
> 	<bean:define id="idSetor" name="setor" property="id" />
> 	<td><html:link action="setoradmin" paramProperty="idSetor" 
> paramName="setor">Detalhes</html:link></td>
>   </tr>
> </logic:iterate>
>
> I correctly generate de table and its values, but i can't generate the 
> parameter i need to add to the link. Of course, this code might be 
> wrong.
> Any sugestions?
>
> thanks, and happy holydays.
>
> Otávio augusto
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


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