Summarized points:
1. During Internal redirection, requests are actually forwarded to another page or servlet through the server. At this time, the target page or servlet to be redirected can obtain the request object, you can also obtain the attributes and parameters in the request. The external jump is actually the first request, and the server sends a command to the client, asking the client to request the server again, at this time, the request object obtained by the server for the second time is not the request object of the first request, so the parameters and attributes in the first request cannot be obtained.
2. the address bar of the internal jump url will not change, and the external jump url will change.
3. The internal jump cannot jump to jsp or servlet other than the project, but the external jump can.
4. Internal jump implementation method:
Java code
- Request. getRequestDispatcher ("XXX. jsp or servlet"). forward (request, response ),
[Java]View plaincopyprint?
- Request. getRequestDispatcher ("XXX. jsp or servlet"). forward (request, response ),
External jump implementation method:
Java code
- Response. sendRedirect ("XXX. jsp or servlet ").