Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

URL encoding gives 404

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running Tomcat 5 on JDK 1.5

I'm getting 404 errors for requests when the URL is encoded which doesn't make sense to me.

i.e.

/mypage.htm?page=A works

/mypage.htm%3fpage=A 404

Shouldn't this be handled automatically by tomcat? I've read the connector configuration docs but haven't been able to resolve this. I added URIEncoding="UTF-8" to my connectors but I don't believe this is even a UTF-8 encoding but ISO-Latin.

I tried URIEncoding="ISO-Latin1" (ISOLatin, ISOLatin1 etc.) to no avail.

Any ideas?

TIA,
Bill
 
Marshal
Posts: 28288
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It makes sense to me. Those two URLs aren't equivalent; the first one refers to the name "mypage.htm" and has a parameter list "page=A" whereas the second one refers to the strange name "mypage.htm%3fpage=A" and doesn't have a parameter list.

Looks like whoever produced the second one wasn't quite clear on how URL-encoding should be used. Only the value parts of parameters in the parameter list need to be URL-encoded.
 
Bill Goldsworthy
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Only the value parts of parameters in the parameter list need to be URL-encoded."

Excellent! We're trying to track down where the request is coming from now that I understand that it's the URL that's bad not because of some inability for Tomcat to decode it.

Much appreciated!
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the whole reason for encoding is so that special characters like the ? (and = and &) can be used to format the URL.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic