?? servletencoding.java
字號:
package hbu.david.cmc.http;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ServletEncoding {
/**
* 將請求與回應的文字編碼都設置成為UTF-8編碼
* @param request
* @param response
*/
public static void setEncoding(HttpServletRequest request,HttpServletResponse response){
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setContentType("text/html; charset=UTF-8");
response.setCharacterEncoding("UTF-8");
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -