在struts中的中文问题
在action里通过form把文字传到JSP页面,可是是乱码。
其实我在form里面已经做了转换
比如action中有setText("你好"),
在form中:
public void setText(String text) {
try{
this.text = new String(text.getBytes("ISO8859_1"),"GBK");
}catch(UnsupportedEncodingException e){}
}
在jsp中contentType="text/html; charset=GB2312"
pageEncoding="GB2312";
我看了很多资料觉的是没有什么问题。请高手帮忙看看,谢谢了 !