JSP를 공부하던 중, 웹 애플리케이션의 web.xml 파일 내 필터 매핑 엘리먼트의 속성 중 하나인 <url-pattern> 엘리먼트 설정을 책의 내용대로 'some_path/*.jsp'처럼 해서 특정 디렉터리('some_path')에 있는 JSP 파일에만 필터를 적용되도록 했더니 톰캣이 뜨면서 오류가 발생한다. 이클립스 콘솔에 출력된 에러 메시지를 보니 'invalid <url-pattern>'이란다.
구글을 찾아보니, Servlet specification 2.4에서 JSP 속성 그룹(jsp-propertity-group)에 허용되는 URL 패턴은 다음과 같단다.
즉, 위와 같이 하려면 '/some_path/*'라고 해야한다.
구글에서 찾은 페이지에 따르면, 톰캣의 이전 버전에서는 'some_path/*.jsp' 같은 것이 가능했다고 한다. 그러나 이것은 Servlet specification을 따르는 것이 아니므로, 수정되었다고 한다.
* 참고 문헌
- http://objectmix.com/java/159394-tomcat-5-0-web-xml-filter-mapping-url-pattern-content-jsp.html
- http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg43676.html
- http://www.coderanch.com/t/84442/Tomcat/write-correct-url-pattern-security
구글을 찾아보니, Servlet specification 2.4에서 JSP 속성 그룹(jsp-propertity-group)에 허용되는 URL 패턴은 다음과 같단다.
- A string beginning with a / character and ending with a /* suffix is used for path mapping.
- A string beginning with a *. prefix is used as an extension mapping.
- A string containing only the / character indicates the "default" servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null.
- All other strings are used for exact matches only.
- A string beginning with a *. prefix is used as an extension mapping.
- A string containing only the / character indicates the "default" servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null.
- All other strings are used for exact matches only.
즉, 위와 같이 하려면 '/some_path/*'라고 해야한다.
구글에서 찾은 페이지에 따르면, 톰캣의 이전 버전에서는 'some_path/*.jsp' 같은 것이 가능했다고 한다. 그러나 이것은 Servlet specification을 따르는 것이 아니므로, 수정되었다고 한다.
* 참고 문헌
- http://objectmix.com/java/159394-tomcat-5-0-web-xml-filter-mapping-url-pattern-content-jsp.html
- http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg43676.html
- http://www.coderanch.com/t/84442/Tomcat/write-correct-url-pattern-security
'Computing > Programming' 카테고리의 다른 글
| Java coding conventions on One Page (0) | 2009/04/16 |
|---|---|
| CHKJ3000E: WAR Validation Failed: java.lang.NullPointerException (0) | 2009/04/11 |
| Servlet specification 2.4에서 JSP 속성 그룹에 유효한 URL 패턴 (0) | 2009/04/11 |
| 이클립스에서 [CHKJ4019W: Invalid res-sharing-scope; valid values are "Shareable" or "Unshareable".] 워닝 해결하기 (0) | 2009/04/01 |
| 이클립스에서 오라클 10g XE 연결 설정하기 (3) | 2009/03/25 |
| 우분투 8.04 HH에 오라클 10g XE 설치 (0) | 2009/03/25 |
TAG jsp,
Programming,
Servlet,
Web Programming,
서블릿,
웹 프로그래밍,
프로그래밍,
대한민국>광주광역시>북구>첨단과기로 261(오룡동)>광주과학기술원>정보통신공학과
댓글을 달아 주세요