Path problem in servlet: scheduling

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.