patient and dentist login page in netbeans using jsp and servlet

by Prof. Bernhard Johnson III 10 min read

javascript - Login page in JSP Servlet - Stack Overflow

24 hours ago  · The right way of displaying a jsp page via a servlet is the following : this.getServletContext().getRequestDispatcher("your_page_url").forward( request, response ); Also remove this part : >> Go To The Portal


How to create a servlet in NetBeans IDE?

Follow the below steps to create the servlet in the NetBeans IDE: Open NetBeans IDE and then select File -> New Project option from the context menu as shown in the below image. It will open the New Project window. From this window, select Java web -> Web Application and then click on the Next button as shown in the below image.

How does the login page work in servlet?

This login page example was developed using Servlet, JSP, and MySQL (MariaDB) database connectivity. When user information passed in a form, it is validated with the record saved into the database table.

What is NetBeans IDE used for?

NetBeans IDE lets you quickly and easily develop Java desktop, mobile, and web applications, as well as HTML5 applications with HTML, JavaScript, and CSS. The IDE also provides a great set of tools for PHP and C/C++ developers.

Which IDE is best for JSP web application development?

Please read our previous article where discussed JSP Web Application Development using the MyEclipse IDE. NetBeans IDE lets you quickly and easily develop Java desktop, mobile, and web applications, as well as HTML5 applications with HTML, JavaScript, and CSS. The IDE also provides a great set of tools for PHP and C/C++ developers.

4. MySQL Database Setup

Let's create a database named "mysql_database" in MySQL. Now, create a login table using below DDL script:

6. Create a LoginDao.java

Let's create a LoginDao class which contains JDBC code to connect with MySQL database. Add the following code to a LoginDao class:

9. Create a loginsuccess.jsp

Note that in the above page, we have used JSP action tags. Read more about action tags here.

9. Demo

It's time to see a demo of the above development. Deploy this web application in tomcat server.

Recommended Answers

Hi...you can JSP and Servlets or simple Java Classes as normal easy way. But i would sugeest you to have it done by using Struts......thats the best way out. You need require to establish connection each time in any of the above cases. Just have one Java class which will …

All 18 Replies

Hi...you can JSP and Servlets or simple Java Classes as normal easy way. But i would sugeest you to have it done by using Struts......thats the best way out. You need require to establish connection each time in any of the above cases. Just have one Java class which will do that for you and let the other classes call the method of that class.