Path problem in servlet: scheduling
(1) Calling the background method
(2) Follow the results to complete the jump
redirect Response.sendredirect (URL);
Forward Request.getrequestdispatcher (URL). Forward (Request,response);
Myservlet:http://localhost/news/myservlet3
1 redirect Response.sendredirect (URL);
Relative path: Response.sendredirect ("a/b.jsp");
http://localhost/news/a/b.jsp
Absolute path: Response.sendredirect ("/a/b.jsp");
http://localhost/a/b.jsp
Myservlet:http://localhost/news/myservlet3
2 forwarding Request.getrequestdispatcher (URL). Forward (Request,response);
Relative path: Request.getrequestdispatcher ("a/b.jsp"). F.;
http://localhost/news/a/b.jsp
Absolute path: Request.getrequestdispatcher ("/a/b.jsp"). F.;
http://localhost/news/a/b.jsp
To make news changes and deletions
(1) Previously Modified and deleted processing page (adminnewsdel.jsp doedit.jsp) Delete No, cut the code into two Servlets
(2) Modifying the path of a jump in a servlet
(3) Page submission address by Jsp-->servlet
(<%=request.getcontextpath%>/servlet/editservlet)
Filter:
(1) Filter All/*
(2) Targeted filtering
For http://localhost:8080/news/jsp/admin/*
http://localhost:8080/news/jsp/login.jsp
Page->user->session->admin/admin.jsp
Filter-->session take User-->chain.dofilter ()/error.jsp
<filter-name>TestFilter</filter-name>
<url-pattern>/jsp/admin/*</url-pattern>
Path problem in servlet: scheduling