Requested twice server, the address bar changes . Servlet1 from the beginning -> becomes the sevlet2
Redirection can be directed to the external network
Redirection address (if it is outside the network) must have to write the name of the project . / day12_web / servlet2
Redirect the final result: the impact of the data in the servlet2
Forward:
He requested a server, without any change in the address bar . servlet1 -> or sevlet1
Forwards not to the external network . Forwarding behavior just inside the server, the client does not know this behavior
Forwarding path not need to write the name of the project . / servlet2. Name because it is within the current project, so the project can be omitted
Data is also forwarded servlet2 final results, the impact of the
When a forward, when to use redirection
External network when needed, can only redirect
General address bar of the browser you want to make changes, then use the redirect (page if Jingdong, the login is successful, jump to the home page, this time it should become a home address of address)
Generally do not want to address changes, use forward (if Jingdong page, login fails, the login page also allows users to continue to log in), once the request is valid request object