wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts1+Hibernate+Tomcat and encoding problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1+Hibernate+Tomcat and encoding problem" Watch "Struts1+Hibernate+Tomcat and encoding problem" New topic
Author

Struts1+Hibernate+Tomcat and encoding problem

Vladimir Riha
Greenhorn

Joined: Jul 18, 2009
Posts: 1
Hi,
I'm trying to create simple application based on Struts1 and Hibernate on ApacheTomcat. But I have problem with saving words in utf8 encoding. I found some hints and so far I have this:
1) All JSP pages starts with

And in head I have meta tag

2) I created simple filter

And put this into web.xml:


3) I configured utf8 in hibernate.cfg.xml file:


Now I have simple form in jsp page with text input field. In my action class I used standard way to get value of the input field
and save it using hibernate. However it works only for some letters, others are save like "?". I'm using NetBeans and so I looked to its HTTP Monitor to see this request and all parameters and it seems to be encoded in windows-1250 so I tried to convert it by

But it is even worst because less letters are saved correctly and others are replaced by characters like .

Could anyone please help me? Thanks
 
Don't get me started about those stupid light bulbs.
 
subject: Struts1+Hibernate+Tomcat and encoding problem