1

I'm stumped. I thought & AND ; were valid delimiters for a query parameter.

It seems that tomcat 7 HttpServletRequest.getParameterValues("key") won't recognize my parameter when it is like this:

http://acme.com/my.jsp?x=1;y=2;z=3

If I go here, there is mention of the semi-colon:

http://en.wikipedia.org/wiki/Query_string

Is there a way to force tomcat 7 to recognize them within this method? Or is there a better method to use?

Thanks.

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
D-Klotz
  • 1,973
  • 1
  • 15
  • 37
  • Are you sending that URL from within HTML and outside a `
    ...
    `?
    – user207421 Oct 02 '14 at 22:17
  • Link to relevant w3.org "Performance, Implementation, and Design Notes", [B.2.2 Ampersands in URI attribute values](http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2) – Joakim Erdfelt Oct 02 '14 at 22:22
  • Sort of previously answered here - http://stackoverflow.com/a/7287629/775715 – Joakim Erdfelt Oct 02 '14 at 22:33
  • 2
    `;` may have been supported in the 90s, but its time to do it right and use `&`. – developerwjk Oct 02 '14 at 22:39
  • I agree with @developerwjk - The `;` recommendation is really just to get around concerns in SGML anyway. – Joakim Erdfelt Oct 02 '14 at 22:43
  • So the answer is, that it is just a minor note within the RFC and not supported in all backend frameworks and not supported at all within HTML 5. Thanks to everyone who commented. – D-Klotz Oct 02 '14 at 22:45
  • 1
    It apparently was supported in Tomcat 5.5.25; just checked an old server I have. – developerwjk Oct 02 '14 at 22:56
  • And that explains a lot. We moved from tomcat 5.5 to tomee plus that is probably the 2nd version of tomee plus to come out. Thanks for checking. – D-Klotz Oct 02 '14 at 23:02
  • 1
    @D-Klotz that note is not part of an IETF RFC, its merely a set of recommendations by the w3 (different organization) – Joakim Erdfelt Oct 02 '14 at 23:04

1 Answers1

1

For closure, this is the bug report outlining why tomcat 7 does not recognize a semicolon as a separator within the query parameter

https://issues.apache.org/bugzilla/show_bug.cgi?id=39740

The last comment before it was marked as "won't fix" is that this can be resolved by implementing a custom filter. Which is of course true.

Thanks to everyone who responded.

D-Klotz
  • 1,973
  • 1
  • 15
  • 37