From the course: Java EE: Servlets and JavaServer Pages (JSP)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding redirection

Understanding redirection

From the course: Java EE: Servlets and JavaServer Pages (JSP)

Start my 1-month free trial

Understanding redirection

- [Woman] Let us now talk about the redirection concept in the servlet specification. If you look at our websites landing page, there are a lot of hyperlinks at the top right corner. One of them has been labeled as LinkedIn. My requirement is that when I click on this hyperlink, it should take me to the LinkedIn website. This exactly is the idea of redirection. So let's take a look at it. When we talk about redirection, it means we are handing over the control outside the current application context. The current application context for our goals is H plus sport, and from there we want to go now to the LinkedIn website. This is how the flow will look. There's a client, whose going to click on the hyperlink of LinkedIn. When the request goes to App Context One, which is the H plus sport application, the application is going to understand that this request is for LinkedIn and I would not be able to serve it. So what it does is it gives a response back to the client stating two things…

Contents