Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002042 [Resin] minor always 10-04-07 09:49 10-01-07 09:18
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution no change required  
Status closed   Product Version 3.1.3
Summary 0002042: JSTL c:url with escaping
Description (rep by Matt White)


Please forgive me if this is a frequently asked question, I have only
recently re-subscribed this list and don't see this issue in the
documentation.

If I have a snippet of JSP code that looks like this:

<a href="<c:url value="someFile.jsp"><c:param name="w"
value="1"/><c:param name="h" value="2"/></c:url>">Click Me!</a>

Resin's JSTL will produce a URL that looks like this:

someFile.jsp?w=1&h=2

...which, if you ask me, is a perfectly valid URL and is the response
I'd expect. The W3C disagrees.


According to the W3C's validator (and the HTML validator plugin for
FireFox I'm using), the URL should be written like this:

someFile.jsp?w=1&amp;h=2

Notice how the & has been escaped into &amp;... one could argue that
this is a silly change as "&amp;" contains "&", but that just the way
these things work... *grumble*


Is there a way to make Resin's JSTL implementation spit out &amp;
instead of & on URLs?
Additional Information
Attached Files

- Relationships

- Notes
(0002418)
ferg
10-01-07 09:18

Resin's c:url is correct. c:url does not XML-escape '&'. You'll need to use c:url with a var parameter and pass the result to c:out and escapeXml='true' to get the XML escaping.
 

- Issue History
Date Modified Username Field Change
10-04-07 09:49 ferg New Issue
10-01-07 09:18 ferg Note Added: 0002418
10-01-07 09:18 ferg Assigned To  => ferg
10-01-07 09:18 ferg Status new => closed
10-01-07 09:18 ferg Resolution open => no change required


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker