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.

Using URL rewriting

Using URL rewriting

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

Start my 1-month free trial

Using URL rewriting

- [Instructor] So, let us now implement the demo for URL Rewriting. The first thing we have to do is, we have to disable the cookies in the browser because we know that URL Rewriting will fit in only when the cookies are disabled. So, let me go to the browser. Go to settings, and you can just search for cookies, here, and you get an option of condense settings, that's the one. You have to click there. And, this is enabled right now. That's something that we will disable. So, when we disable, the cookies are gone now. Alright? So, the first step is done. Now, let's go ahead and write LoginServlet and set up the session. In our code, we already have the LoginServlet which we had utilized for the Request Dispatcher demo, so that's already ready with us. Now, we've just added the new post method, and that's the place we want to do some things, right? Now, please note that under the HTML folder, the home.jsp and profile.jsp, these files weren't functional before, but now we're going to use…

Contents