You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Andersson <ma...@active-tv.com> on 2002/10/15 16:59:24 UTC

Link tag and jsp expressions

Hello

I want to the following:
<html:link
page="/do/showprojectdetails?<%=project.getProjectId()%>"><%=project.getName
()%></html:link>

When this is executed the following output is generated:
<a
href="[context]/do/showprojectdetails?<%=project.getProjectId()%>">TheProjec
tName</a>

This is of course wrong, I want the project id to be written to the query
string in the link url. What is wrong or what should I do instead?

/Marcus

__________________________________________________ 
Marcus Andersson 
Project Leader and Application Developer 
ActiveTV AB 
Östgötagatan 19 
Box 124 
581 02 LINKOPING 
Phone: +46 13 461 80 28 
Mobile: +46(0)709-29 96 68 
Fax: +46 13 461 80 99 
E-mail: marcus.andersson@active-tv.com 
Web: www.active-tv.com <www.active-tv.com>  
__________________________________________________ 



Re: Link tag and jsp expressions

Posted by Dave Derry <dd...@acm.org>.
DISCLAIMER: I have never done this, but I have seen it explained on this
list enough times that I feel that I understand it well enough to respond.

Your problem is that the scriplet is only a portion of the attribute, and is
therefore not being interpreted. You need to do it like this:  page='<%=
"/do/showprojectdetails?" + project.getProjectId()
%>'><%=project.getName()%>

!'m assuming that you really do want just a value following the '?' and not
the typical 'XXX=YYY'. Otherwias you probably need to use paramName and
paramValue as someone else suggested.

Hope this was useful,
Dave Derry

----- Original Message -----
From: "Marcus Andersson" <ma...@active-tv.com>


Hello

I want to the following:
<html:link
page="/do/showprojectdetails?<%=project.getProjectId()%>"><%=project.getName
()%></html:link>

When this is executed the following output is generated:
<a
href="[context]/do/showprojectdetails?<%=project.getProjectId()%>">TheProjec
tName</a>

This is of course wrong, I want the project id to be written to the query
string in the link url. What is wrong or what should I do instead?

/Marcus



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