문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
groovy:groovlet [2012/09/05 18:31] kwon37xi [기본 내장 객체 목록] |
groovy:groovlet [2012/09/07 11:10] kwon37xi |
||
---|---|---|---|
줄 47: | 줄 47: | ||
</ | </ | ||
- | * contextPath : '' | + | |
===== session ===== | ===== session ===== | ||
세션 사용시 주의해야 한다. session 내장 객체가 null 일수 있기 때문이다. | 세션 사용시 주의해야 한다. session 내장 객체가 null 일수 있기 때문이다. | ||
줄 99: | 줄 99: | ||
* ''< | * ''< | ||
* '' | * '' | ||
+ | |||
+ | ===== 사용자 정의 내장 객체 넣기 ===== | ||
+ | GroovyServlet과 TemplateServlet을 상속받아서 [[http:// | ||
+ | |||
+ | web.xml 에서 servlet-mapping 등록은 자신이 만든 클래스로 변경해줘야 한다. | ||
+ | <code java> | ||
+ | public class LogViewerTemplateServlet extends TemplateServlet { | ||
+ | |||
+ | private static final long serialVersionUID = 1L; | ||
+ | |||
+ | @Override | ||
+ | protected void setVariables(ServletBinding binding) { | ||
+ | HttpServletRequest request = (HttpServletRequest)binding.getVariable(" | ||
+ | HttpServletResponse response = (HttpServletResponse)binding.getVariable(" | ||
+ | ServletContext context = (ServletContext)binding.getVariable(" | ||
+ | |||
+ | binding.setVariable(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||