當前位置:學者齋 >

IT認證 >JAVA認證 >

關於struts的解決方法

關於struts的解決方法

Java需要我們學習相當多的'知識,下面YJBYS小編為大家整理了關於關於struts的解決方法文章,希望對你有所幫助。

關於struts的解決方法

try {

haracterEncoding(“GBK”);

tln(“字符成功轉向”);

} catch (UnsupportedEncodingException e) {

tStackTrace();

tln(“字符轉向失敗!”);

}

問題依舊,後來才明白,應該這樣做:

1,寫一個類,繼承RequestProcessor

import pportedEncodingException;

import ServletRequest;

import ServletResponse;

import estProcessor;

public class EnRequestProcessor extends RequestProcessor {

@Override

protected boolean processPreprocess(HttpServletRequest request,

HttpServletResponse response) {

// TODO Auto-generated method stub

try {

haracterEncoding(“GBK”);

tln(“字符成功轉向”);

} catch (UnsupportedEncodingException e) {

tStackTrace();

tln(“字符轉向失敗!”);

}

return true;

}

}

然後,在裏寫入:

在《/action-mappings》後面加,不要加在裏面哦~~

《controller processorClass=“questProcessor”》《/controller

標籤: struts
  • 文章版權屬於文章作者所有,轉載請註明 https://xuezhezhai.com/zh-hk/itrz/java/mnrrdg.html