You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Billy Ng <ev...@hotmail.com> on 2002/07/02 09:55:48 UTC

query string

I try to use the html:link tag

<html:link page="/products.do<%= product.getProductID() %>">Product 
1</html:link>

to render the link like

<a href="/myWebapp/products.do?id=1">Product 1</a>

However, it becomes

<a href="/myWebapp/products.do?<%= product.getProduct() %>">Product 1</a>

What did I do wrong?  What is the right way to put the query string to 
html:link tag?

Thanks!

Billy Ng



_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: query string

Posted by Duke Ronlund <du...@bigpond.com>.
Hi, 

The html:link tag provides paramId, paramName and paramProperty
attributes for this very purpose.

so 

<html:link page="/products.do<%= product.getProductID() %>">Product 
 1</html:link>

would become 

<html:link page="/products.do" paramId="id" paramName="BeanName"
paramProperty="productId">Product 1</link>

Duke

> I try to use the html:link tag
> 
> <html:link page="/products.do<%= product.getProductID() %>">Product 
> 1</html:link>
> 
> to render the link like
> 
> <a href="/myWebapp/products.do?id=1">Product 1</a>
> 
> However, it becomes
> 
> <a href="/myWebapp/products.do?<%= product.getProduct() %>">Product 1</a>
> 
> What did I do wrong?  What is the right way to put the query string to 
> html:link tag?
> 
> Thanks!
> 
> Billy Ng
> 
> 
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: query string

Posted by fabrice dewasmes <fd...@kaptech.com>.
Hi,

if you've got only one parameter here's what you should write

<html:link page="/products.do" paramId="id" paramName="product"
paramProperty="product">Product 1</html:link>

for more parameters it rapidly becomes more problematic : you have to pass a
bean which has a map of paramName - value to build the whole link.

Fabrice

> -----Message d'origine-----
> De : Billy Ng [mailto:evebill8@hotmail.com]
> Envoyé : mardi 2 juillet 2002 09:56
> À : struts-user@jakarta.apache.org
> Objet : query string
>
>
> I try to use the html:link tag
>
> <html:link page="/products.do<%= product.getProductID() %>">Product
> 1</html:link>
>
> to render the link like
>
> <a href="/myWebapp/products.do?id=1">Product 1</a>
>
> However, it becomes
>
> <a href="/myWebapp/products.do?<%= product.getProduct() %>">Product 1</a>
>
> What did I do wrong?  What is the right way to put the query string to
> html:link tag?
>
> Thanks!
>
> Billy Ng
>
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>