WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ... >
<servlet>
<servlet-name>Servlet that filter forbidden</servlet-name>
<servlet-class>my.package.ForbiddenServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet that filter forbidden</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
my.package.ForbiddenServlet.java
public class ForbiddenServlet extends HttpServlet {
public ForbiddenServlet() {
}
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
// super.service(req, res);
res.sendError(HttpServletResponse.SC_FORBIDDEN);
}
}
'Programming > Java' 카테고리의 다른 글
String equals 와 == 연산자의 차이 (0) | 2018.08.24 |
---|---|
java -jar 옵션 사용시 classpath 설정 불가능 문제 (0) | 2018.03.22 |
사용 메모리 확인 (0) | 2018.03.05 |
[eclipse] Maven build 할 때 build path에 포함됐는데도 package does not exist 가 뜰 때 (2) | 2016.09.28 |