문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
groovy:groovlet [2012/09/05 15:31] kwon37xi |
groovy:groovlet [2012/09/07 11:10] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 16: | 줄 16: | ||
| * 서블릿 '' | * 서블릿 '' | ||
| + | * ''/ | ||
| * 기타 groovy 라이브러리성 파일들은 '' | * 기타 groovy 라이브러리성 파일들은 '' | ||
| + | |||
| ===== 기본 내장 객체 목록 ===== | ===== 기본 내장 객체 목록 ===== | ||
| 줄 45: | 줄 47: | ||
| </ | </ | ||
| - | + | * contextPath : '' | |
| ===== session ===== | ===== session ===== | ||
| 세션 사용시 주의해야 한다. session 내장 객체가 null 일수 있기 때문이다. | 세션 사용시 주의해야 한다. session 내장 객체가 null 일수 있기 때문이다. | ||
| 줄 96: | 줄 97: | ||
| * ''< | * ''< | ||
| * ''< | * ''< | ||
| - | * ''< | + | * ''< |
| - | * '' | + | * '' |
| + | |||
| + | ===== 사용자 정의 내장 객체 넣기 ===== | ||
| + | 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(" | ||
| + | } | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||