WebWork Velocity Chinese Problem solving

Source: Internet
Author: User
Tags add character set
Web| Solutions | questions | Chinese

Webwork+velocity Chinese Problem Resolution: 1, Webwork.properties file, add:

webwork.i18n.encoding = GB2312

It is primarily used to set the encoding of the WebWork UI tag library If it is not set to pass

System.getproperty ("file.encoding") to obtain the default character encoding. 2, Velocity.properties file, add:



default.contenttype=text/html; charset=gb2312

It is used to set the. VM page encoding 3, write a filter, set the encoding to GB2312. For details, see the Setcharacterencodingfilter file and Web.xml configuration in the attachment.

it resolves the encoding when the action data is passed. Recommendation: Chinese code recommended unified use: GBK, its character set is more complete than GB2312.

(keywords: Java, JSP, Servlet, template, templates, Apache, Jakarta, Velocity webwork)

Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.