mysql数据库?如果是那样的话,应该配置你的数据库字符

解决方案 »

  1.   

    public class SysRequestProcessor
    extends org.apache.struts.action.RequestProcessor {

    /**
     * 设置输入输出字符集
     */
    protected boolean processPreprocess(HttpServletRequest request,HttpServletResponse response) {

    try {
    request.setCharacterEncoding("GBK");
    response.setContentType("text/html;charset=GBK");
    }
    catch (Exception e) {

    }

    return true;

    } }
    struts-config里面的配置:<controller
      contentType="text/html;charset=GBK"
      locale="true"
      nocache="true"
      processorClass="com.smcc.uer.web.actions.SysRequestProcessor"/>
      

  2.   

    sqlserver2000,数据库字符怎么配?
      

  3.   

    我不是要页面的转换乱码,希望能够通过hibernate配置文件或者方法,在取数据时就能够正确。
      

  4.   

    hibernate取出数据后 就是乱码了么?还是返回到页面上乱码的?