aspose file tools*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem using html:link" Watch "problem using html:link" New topic
Author

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
Sheriff

Joined: Dec 10, 2001
Posts: 7023
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!


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

Joined: Aug 18, 2004
Posts: 157
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem using html:link