我的jsp頁面怎么沒有打開呢?
web.xml
<?xml?version="1.0"?encoding="UTF-8"?> <web-app?version="2.4"?xmlns="http://java.sun.com/xml/ns/j2ee" ????xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ????xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee? ??????http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <welcome-file-list> ????<welcome-file>index.jsp</welcome-file> </welcome-file-list> ????<filter> ????????<filter-name>FirstFilter</filter-name> ????????<filter-class>com.imooc.filter.FirstFilter</filter-class> ????</filter> ????<filter-mapping> ????????<filter-name>FirstFilter</filter-name> ????????<!--?/*代表了所有連接,如果是index前綴的,可以寫成/index*?--> ?????????<url-pattern>/*</url-pattern>? ????</filter-mapping> </web-app>
index.jsp
<%@?page?language="java"?import="java.util.*"?pageEncoding="UTF-8"%> <% String?path?=?request.getContextPath(); String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"> <html> ??<head> ????<base?href="<%=basePath%>"> ???? ????<title>My?JSP?'index.jsp'?starting?page</title> ????<meta?http-equiv="pragma"?content="no-cache"> ????<meta?http-equiv="cache-control"?content="no-cache"> ????<meta?http-equiv="expires"?content="0">???? ????<meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3"> ????<meta?http-equiv="description"?content="This?is?my?page"> ????<!-- ????<link?rel="stylesheet"?type="text/css"?href="styles.css"> ????--> ??</head> ?? ??<body> ????This?is?my?JSP?page.?<br> ????<% ????System.out.println("處理過程完成"); ?????%> ??</body> </html>
2016-08-18
原來是我沒在doFilter方法里寫:arg2.doFilter(arg0, arg1);