(1)修改ActionServlet類中的process方法
在web.xml中有一行:
這個ActionServlet類即是默認的Servlet進入點。
為了使系統(tǒng)使用不同的編碼,可以繼承此ActionServlet類,并修改其中的process方法,生成一個新的Servlet進入點:
request.setCharacterEncoding ("MS950") ;
super.process (request, response) ;
這樣就可以正確處理繁體中文了。
(2)使用Unicode字符
系統(tǒng)中的字符全部使用Unicode字符。這樣在不同的語言環(huán)境下運行系統(tǒng),所有字符都可以正常顯示。