struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerome Jacobsen" <jerome.jacob...@gentootech.com>
Subject RE: html:link with Map parameters generating &amp; instead of &
Date Wed, 24 Apr 2002 19:27:41 GMT
I understand that & is a special HTML character.  However isn't it a bug
that html:link generates &amp; instead of &?  I mean the whole idea of using
the html:link with the java.util.Map is so it creates the anchor with
parameters correctly.  That means putting the special character '&' as a
parameter seperator instead of the escaped version.  Or am I missing
something?

-----Original Message-----
From: Alex Jones [mailto:alex.jones@unclealex.co.uk]
Sent: Wednesday, April 24, 2002 3:22 PM
To: 'Struts Users Mailing List'; jerome.jacobsen@gentootech.com
Subject: RE: html:link with Map parameters generating &amp; instead of &


It's to do with & being a reserved character in HTML. I had the same
problem but got round it by writing a method a bit like the following:

public String getParameter(HttpServletRequest request, String paramName)
{
  String paramValue = request.getParameter(paramName);
  if (paramValue == null) return request.getParameter("amp;" +
paramName);
  else return paramValue;
}

-----Original Message-----
From: Jerome Jacobsen [mailto:jerome.jacobsen@gentootech.com]
Sent: 24 April 2002 18:44
To: Struts User
Subject: html:link with Map parameters generating &amp; instead of &

Hi,

I've tried this with Struts 1.0.1 and Struts 1.0.2 and both do the same
thing.

  <%
       HashMap summaryLinkParms = ...
       pageContext.setAttribute("summaryLinkParms", summaryLinkParms);
  %>
  <html:link href="index.jsp" name="summaryLinkParms">
  inventory summary
  </html:link>

The above creates a URL in which the parameter seperator is &amp;
instead of
&!

<a href="index.jsp?param1=blah&amp;param2=bleh">inventory summary</a>

I want

<a href="index.jsp?param1=blah&param2=bleh">inventory summary</a>

What's up?


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>







--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message