====== Java Servlet ====== ===== 현재 Full URL ===== String file = request.getRequestURI(); if (request.getQueryString() != null) { file += '?' + request.getQueryString(); } URL reconstructedURL = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), file); out.println(URL.toString()); ==== Libraries ==== * [[http://tuckey.org/urlrewrite/|UrlRewriteFilter]] ===== NoCache ===== // 페이지 캐시를 막고, 뒤로가기 버튼을 눌러 올 경우에도 페이지 처리 요청을 새로 보낸다. httpResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0"); httpResponse.setHeader("Expires", "0"); ===== Cookie ===== * [[http:cookie|Cookie]] * [[http://docs.oracle.com/javaee/5/api/javax/servlet/http/Cookie.html|Cookie]] * ''setMaxAge'' : A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted. * ''-1'' : 세션 쿠키. 브라우저 켜져 있는동안 유지. 브라우저 끄면 삭제. * ''0'' : 즉시 삭제 * ''양수'' : 쿠키 유지 초(seconds) ===== Servlet Request Attribute ===== * ''javax.servlet.forward.request_uri'' : forward 시에 original URI