This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes problem using html:link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem using html:link" Watch "problem using html:link" New topic

problem using html:link

siva kumar
Ranch Hand

Joined: Sep 03, 2004
Posts: 86
<html:link href="MovieDetails.jsp?moviename=<%=mname%>">go</html:link>
In the above statement instead of evaluating <%=mname> statement it's just taking it as a string.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023

Welcome to JavaRanch!

We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.

We request that display names follow the pattern FIRST_NAME + SPACE + LAST_NAME.

Thanks Pardner! Hope to see you 'round the Ranch!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157

If you check the documentation for the link tag you will see that the href attribute value is allowed to be a runtime expression [RT Expr].

What this means is that something like this is allowed -
<html:link href="<%=someRuntimeExpression%>">.

However, if the attribute value is not an expression, then it is treated as having a fixed value at JSP translation time (as in your case).

You could try this.
<html:link href="<%="MovieDetails.jsp?moviename="+mname%>">go</html:link>

rocket mass heater kickstarter
subject: problem using html:link