• 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

unable to handle special characters in struts

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

we are entering some mexicon values in text box but while printing corresponding form value from the action class(in console), some characters are replaced by question mark.So I am unable to save the expected value in database. For example if we are entering "Operaci�n fall�" in text box but while printing it in console it is printed as "Operaci??n fall??" so the same will be saved in database also.

I think the problem is occuring while struts handling forms.Please suggest me how we can resolve this issue.

Best Regards,
Thomas
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just make sure you set the encoding character set properly and it will work. Something like this:

<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" %>

Don't worry about what shows in a System.out.println(). The question marks don't mean there is anything wrong with the data. As long as when you retrieve the data back from the database it displays properly on the form, that's all that matters.
 
Thomas vezhamb
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Merryl,
Actually with the value we are getting from the form, we are making a xml file and sending to Oblix for saving in to LDAP. But while we creating xml file with the form bean value the special characters are replaced with question mark. In a nutshell we are unable to send the right value through the xml request. That creates the issue.

I have already done as you suggested, but I think, this is not related to display problem in Jsp.

Regards,
Thomas
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic