Lab03 SearchUsers
Lab03 SearchUsers
Lab Objectives
In this lab, you will be:
▪ Create Java web project using the NetBean IDE
▪ Create the web pages by HTML
▪ Apply passing data from HTML to Servlet by GET and POST method
▪ Apply RequestDispatcher to pass data between Servlets
▪ Performs CRUD functions by SqlJDBC driver and SQL Server
▪ Run the project and test the functions of the application
1|Page
Step 01. Create a Java Web application named Lab03_SeachUsers is
structured as follows:
2|Page
Step 02. Write codes for the classes in the DBUtils package as the follows:
• User.java
• UserDAO.java
3|Page
4|Page
5|Page
Step 03. Write codes for the classes in the UserServlet package as the
follows:
• LoginServlet.java
6|Page
• ProcessServlet.java
7|Page
• SearchServlet.java
• ShowSearchResultServlet.java
8|Page
• RemoveServlet.java
9|Page
Step 04. Write HTML codes for the web pages as the follows:
• Login.html page
• Invalid.html page
• Search.html page
10 | P a g e
Step 05. Open the web.xml in the WEB-INF folder then update as the follows:
Step 06. Right-click on Lab03_SearchUsers project, select Run to run the web
app then test all functions.
11 | P a g e