• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pageEncoding="UTF-8" in jsp

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My problem is ,when <%@page pageEncoding="UTF-8"%> is included in a jsp file labels can be displayed in a whatever language we want.But if we want to submit a value of a text box in the same jsp file and again display the submitted value in a UTF-8 encoded jsp file it is not desplayed in the correct language format.Is there a way to solve this problem?
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi piyuma, welcome to javaranch.

I didn't understand your question properly, but how did you enter a value of a different language in a text field in a JSP page?? If you are entering normal english characters and are getting a different value as a response, then I'm clueless about this...
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe this could give you some idea...
 
piyuma Mudalige
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
thank you , I'll refer the sites given.My problem is this. I have some text boxes in a jsp .<%@page pageEncoding="UTF-8"%> is included in this jsp. I have set the keyboard language to Arabic and when I run the application I'm entering Arabic words as the text box values.I'm saving those values to the database and get the data and trying to display them again in another jsp page.Then they are not displayed in Arabic.Because the data is saved to the database in some unknown format.
But when I remove the <%@page pageEncoding="UTF-8"%> from the jsp file data is saved in a format that i can display them again in a jsp in the correct language format.But then the problem is when <%@page pageEncoding="UTF-8"%> is removed from the jsp file can't display labels of that jsp in Arabic language.For the Arabic labels displaying "??? ".
I want both to display Arabic labels and save Arabic values in the correct format .



Ankit Garg wrote:Hi piyuma, welcome to javaranch.

I didn't understand your question properly, but how did you enter a value of a different language in a text field in a JSP page?? If you are entering normal english characters and are getting a different value as a response, then I'm clueless about this...

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Storing the characters in UTF-8 is the standard way.When you read back the values from db,they will be in UTF-8.Your browser is not able understand the UTF-8 characters.
I think you have not set the encoding for your application server.I mean if it is tomcat there is a parameter to set encoding in Connector element.
Let me know in case of any issues
 
piyuma Mudalige
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks, I set the encoding in tomcat.Then the Arabic values entered in jsp are coming to the Action in Arabic format.I put a break point in the Action class and tested.But they are saved into the database as"¿¿¿¿¿¿¿¿¿¿¿¿"


Surya Kant wrote:Storing the characters in UTF-8 is the standard way.When you read back the values from db,they will be in UTF-8.Your browser is not able understand the UTF-8 characters.
I think you have not set the encoding for your application server.I mean if it is tomcat there is a parameter to set encoding in Connector element.
Let me know in case of any issues

 
reply
    Bookmark Topic Watch Topic
  • New Topic