You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Subhadra Vemuri <su...@cisco.com> on 2002/02/06 00:28:41 UTC

Trouble having a jsp scriplet in the value attribute of html:link tag

Could someone please help me with the following?

I have the following struts html tag in my jsp file:
<html:link
href="editLink.do?formAction=edit&linkId=<%=URLEncoder.encode(String.valueOf
(lLink.getLinkId()))%>">

The jsp expression does not evaluate but goes to the editLink.do uri as
is.

However, if I make a minor change to the above stmt so it looks as follows,
the expression evaluates ok:
<html:link href="<%=URLEncoder.encode(String.valueOf(lLink.getLinkId()))%>">

Would appreciate any help on this.

Thanks,
Subhadra


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


RE: Trouble having a jsp scriplet in the value attribute of html:link tag

Posted by Aamir Saalam <as...@cisco.com>.
Subhadra,

  <%
    String linkIdStr = "123";

    Map map = new Hashtable();
    map.put("formAction", "edit");
    map.put("linkId", linkIdStr);

    pageContext.setAttribute("ExampleMapBean", map, PageContext.PAGE_SCOPE);
  %>
  
  <html:link href="editLink.do" name="ExampleMapBean">xyz_1</html:link>


After going through the documentation at 
  http://jakarta.apache.org/struts/struts-html.html#link

I tried the above modification, and it works.


--aamir

-----Original Message-----
From: Subhadra Vemuri [mailto:subvemur@cisco.com]
Sent: Tuesday, February 05, 2002 3:29 PM
To: Struts Users Mailing List (E-mail)
Subject: Trouble having a jsp scriplet in the value attribute of
html:link tag


Could someone please help me with the following?

I have the following struts html tag in my jsp file:
<html:link
href="editLink.do?formAction=edit&linkId=<%=URLEncoder.encode(String.valueOf
(lLink.getLinkId()))%>">

The jsp expression does not evaluate but goes to the editLink.do uri as
is.

However, if I make a minor change to the above stmt so it looks as follows,
the expression evaluates ok:
<html:link href="<%=URLEncoder.encode(String.valueOf(lLink.getLinkId()))%>">

Would appreciate any help on this.

Thanks,
Subhadra


--
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>