This is Part III of this jsp and servlet login tutorial. Check Part I and Part II here.
Step 8 ) We are done with the DAOs and Beans. Now we need to create a database from where we will get the authentication details like Username and Password. So, create a database named code2java and therein add a new Table called users. Please take care of the names you provide to table columns. Continue reading “Login Example: JSP and Servlets: Part III.”
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.”