Login Example: JSP and Servlets: Part II.

Hello Friends,

This is part II of jspĀ and servlets login example. Check Part I here.

Step 4) Now, we need to create a Servlet file for the redirection of the jsp pages. In the src folder under the package code2java, add the Servlet file and name it as LoginServlet. As discussed earlier this servlet file will get the user details from the Bean file and then it will create a Session for that user only if the user is a valid user. And accordingly it will redirect to the respective jsp pages. You can use the default code which Eclipse generates while Servlet creation, the only change you need to do is in doGet() method. Continue reading “Login Example: JSP and Servlets: Part II.”