You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ryan Norman <ra...@mminternet.com> on 2002/03/28 23:45:33 UTC

Passing JSP Variable Values to tag - Ryan Norman

Hi,

I am Ryan Norman.

The JSP variable userID is never evaluated. It displays the URL as 
<a href="/strutstest1/viewUser.do?UserID=<%= userID %>ADMINISTRATOR</a>

Does anybody know how to make this work. 

<html:link page="/viewUser.do?UserID=<%= userID %>">
    <%= userID %>
</html:link>

Thanks

Ryan Norman


Re: Passing JSP Variable Values to tag - Ryan Norman

Posted by Ivan Siviero <iv...@concept.it>.
Why using scriplet when you have struts ?
A better solution should be

<html:link page="/viewUser.do" paramId="UserID" paramName="userid">
link string
</html:link>

the "paramName" parameter is a bean which contains the value to pass to
request.
hope this helps
Ivan.


----- Original Message -----
From: "Mittar, Harpreet" <ha...@wipro.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, March 29, 2002 2:15 PM
Subject: Re: Passing JSP Variable Values to <html:link> tag - Ryan Norman


> try putiing the expression tag within double quotes.
> "<%=userID%>"
>
> ----- Original Message -----
> From: "Ryan Norman" <ra...@mminternet.com>
> To: "Struts User Mailing List" <st...@jakarta.apache.org>
> Sent: Thursday, March 28, 2002 05:45 PM
> Subject: Passing JSP Variable Values to <html:link> tag - Ryan Norman
>
>
> Hi,
>
> I am Ryan Norman.
>
> The JSP variable userID is never evaluated. It displays the URL as
> <a href="/strutstest1/viewUser.do?UserID=<%= userID %>ADMINISTRATOR</a>
>
> Does anybody know how to make this work.
>
> <html:link page="/viewUser.do?UserID=<%= userID %>">
>     <%= userID %>
> </html:link>
>
> Thanks
>
> Ryan Norman
>
>
>
>


----------------------------------------------------------------------------
----


> --
> 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: Passing JSP Variable Values to tag - Ryan Norman

Posted by "Mittar, Harpreet" <ha...@wipro.com>.
try putiing the expression tag within double quotes.
"<%=userID%>"

----- Original Message ----- 
From: "Ryan Norman" <ra...@mminternet.com>
To: "Struts User Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, March 28, 2002 05:45 PM
Subject: Passing JSP Variable Values to <html:link> tag - Ryan Norman


Hi,

I am Ryan Norman.

The JSP variable userID is never evaluated. It displays the URL as 
<a href="/strutstest1/viewUser.do?UserID=<%= userID %>ADMINISTRATOR</a>

Does anybody know how to make this work. 

<html:link page="/viewUser.do?UserID=<%= userID %>">
    <%= userID %>
</html:link>

Thanks

Ryan Norman




RE: Passing JSP Variable Values to tag - Ryan Norman

Posted by Tim Sawyer <ts...@nildram.co.uk>.
Try:

<html:link page="/strutstest1/viewUser.do"  paramId="UserID"
paramName="BeanName" paramProperty="userID"><bean:write name="BeanName"
property="userID"/></html:link>

Where BeanName is a JavaBean and userID is a property of that bean that
contains the value of userID you want to pass on the URL.

Try to get out of the habit of using scriptlets in your pages, I'm just
starting with struts and trying to remove all code, and just use custom
tags.  It makes things simpler.

Tim.

-----Original Message-----
From: Ryan Norman [mailto:radinfo@mminternet.com]
Sent: Thursday, March 28, 2002 10:46 PM
To: Struts User Mailing List
Subject: Passing JSP Variable Values to <html:link> tag - Ryan Norman


Hi,

I am Ryan Norman.

The JSP variable userID is never evaluated. It displays the URL as
<a href="/strutstest1/viewUser.do?UserID=<%= userID %>ADMINISTRATOR</a>

Does anybody know how to make this work.

<html:link page="/viewUser.do?UserID=<%= userID %>">
    <%= userID %>
</html:link>

Thanks

Ryan Norman




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