<%!
public static void setCookie(HttpServletResponse response, String name, String value) throws Exception {
value = java.net.URLEncoder.encode(value.toString(),"UTF-8");
Cookie cookie = new Cookie(name,value);
cookie.setDomain("www.sss.co.kr");
cookie.setPath("/");
response.addCookie(cookie);
}
public static String getCookie(HttpServletRequest request, String CookieName) throws Exception {
Cookie [] cookies = request.getCookies();
if (cookies==null) {
return null;
}
String value="";
for(int i=0; i<cookies.length; i++) {
if(CookieName.equals(cookies[i].getName())) {
value = java.net.URLDecoder.decode(cookies[i].getValue(),,"UTF-8");
break;
}
}
return value;
}
%>
eclipse에서의 JAVA Compile 환경 설정하기 (0) | 2008.03.05 |
---|---|
한글과 UNICODE (0) | 2007.12.13 |
JAVA DB연결 (0) | 2007.12.13 |
JAVA 에러대처 (0) | 2007.12.13 |
JAVA : 상대경로로 절대경로 얻기 (0) | 2007.12.13 |