Employee Management System Project JSP Servlet

org. comp.model Employee Model – Employee.java

Employee Controller Servlet added org.comp.controller package is used for controller AddEmployee.Java





Data Access Object ConnectionFactory.java


HTML Pages ListEmployees.jsp





Sending data to servlet using http get method

Gererally http get is used to get information from server, but for getting specific information based on id or user name or based on query string we send id,user name or search term query to server. Here we have created a form tag and two text box to take input age and name from user. … Read more

Submitting data to servlet using http post

Data sent using http post method is not visible at browser address bar index.jsp

All the services of this website is free. Before using the services you have to register Provide all details Fname Lname Mail Id Mobile No DOB


Your Registration Detail

Name :” + name + “

Read more

Request dispatcher forwarding request

For login example we are using user mail id and password. if both are correct then we are forwaring to home.jsp page if any on of mail id or password is in correct then it will forwarded back to index.jsp page with appropriate error message. index.jsp

Login Page <% String message = (String) request.getAttribute(“error”); … Read more

getting all request parameters in servlet

before this we have used request.getParameter(String) which is used to get a single request parameter value. Now if we want to get all parameter names then we have to use request.getParameterNames() it returns Enumeration of String objects of all parameter names. After getting all parameter names we can get its value using request.getParameter(String) . request.getParameterNames() … Read more

Getting parameter values in Servlet getParameterNames

Project Explorer : index.jsp

Getting all parameter values in servlet Name: Contact No: Email: Web site


Parameter name and values are




Servlet Annotation WebServlet Example

The first example is to show Servlet Welcome using Servlet Annotation WebServlet. For this we have created an index.html page on index.html we have created a link. On clicking on link it will call welcome servlet. Our project directory structure is as per below index.jsp

Show welcome servlet


Servlet Welcome

Read more

Servlet url and class mapping using web.xml

We can map url pattern with servlet class at web.xml. Following example will illustrate this. Project directory structure is as below: index.jsp



In web.xml url pattern(welcome1) will match to a logical name(welcome) that logical name is matched with servlet fully qualified class name(ebhor.servlet.Welcome1). Result:

Java Servlet Response JSON in JSP using Gson

In Modern web applications, We get data from the server in JSON format and display data in JSP or HTML page using Front end library or frameworks like Angular, React, etc. This is similar to mobile app development. Here we will see how we can get JSON Response from the servlet and show it in … Read more

ServletConfig to access multiple initial parameter value

ServletConfig is ued to configure the servlet. We can configure values in the ServletConfig object and can access them later on. There can one or more values can be stored. ServletConfig stores values in key values pair. ServletConfig to access initial parameter value All values are stored in key-value pairs in <servlet> the tag in … Read more