• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

How to make SendRedirect to work without setting URIEncoding="UTF-8" in tomcat server.xml  RSS feed

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am having URL with special characters ₤€ñ₧™Ω۞

code :
encodeUrl = URLEncoder.encode(mystrg, "UTF-8");
response.sendRedirect(encodeUrl );

After response.sendRedirect(encodeUrl ); the special characters are getting changed.
if I add the parameter URIEncoding="UTF-8" for the Connector tag in server.xml(tomcat) it is working fine!

But the requirement is not to change the server.xml. Could some let me know whether it is possible without changing server.xml file and getting the same outcome?


Regards,
Sarada.
 
Sheriff
Posts: 21742
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat must use the same encoding to decode them as you used for encoding. That means that you have two possibilities:
1) You modify the encoding for encoding to the one Tomcat uses (which probably won't work as these characters don't look like many encodings support them).
2) You modify the encoding Tomcat uses to the one you use for encoding.

You may not want to (or cannot) choose option 2, but unless you can get option 1 to work you have no other option.
 
sarada bokka
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your inputs
 
Rob Spoor
Sheriff
Posts: 21742
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!