Hey guys, lately, I use the combination of Struts and Velocity frameworks to create some website, the problem is that when I tried to input UTF-8 Japanese character, say, a field name, which I putted in the value of "索", then I click submit ( using ), the data would be passed to an AddForm, which I have the String name field to handle the name field. Problem is that, the received string is some strange letter than the expected string "索", I set all the workspace to UTF-8, in velocity.property ( input.coding/outputcoding = UTF-8 ), content-type/charset = UTF-8, but it always returns strange string, I could set the name field directly with : public void setName(String name) { this.name = "索" } and the confirm Add work fine, but not with normally insert it to name field on the addForm, someone could point me out what was wrong ? Thanks for patient reading :D.
相关问题
- How can I refactor HTML markup out of my property
- javax.servlet.ServletException: javax.servlet.jsp.
- java.lang.ClassCastException during action chainin
- Issue with Tomcat pooling with Hibernate. MySQL ti
- How to “logic:iterate” just one object?
相关文章
- Does Java 11 or 12 supports Struts 1.3?
- Uploading a file in struts1
- How to set the values in session?
- Redirect or forward
- javax.xml.ws.WebServiceException: Undefined port t
- Struts Plugin for Eclipse Helios (Ubuntu)
- Lift filter to force ssl
- Cannot find the tag library descriptor for /WEB-IN
I understood your problems is as follows, is this right?
This is caused by mismatch between:
It can be solved by specifying server-side encoding (2nd of above) explicitly using
CharacterEncodingFilter
of Spring Framework.(note: Japanese frameworks such as Seasar and TERASOLUNA have similar filter and articles on the problem.)