问:为什么struts一个界面用户输入中文,但是 传递给另一个界面时却只能得到一串????。传英文就没有问题 。
答:
要作转换
public String chStr(String str) {
        if (str==null) {str=""; }
        else {
                try { str=(new String (str.getBytes("iso-8859-1"),"GB2312")).trim();
                } catch (Exception e) {
                        System.out.println("chStr");
                        System.out.println(e.getMessage());
                }
        }
        return str;
     }