Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem using html:link

 
siva kumar
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
balasubramanian,

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!
 
Sheldon Fernandes
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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>

Sheldon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic