Sending data to servlet HTTP get method

Here we will discuss Servlet HTTP get method What is a Servlet? A servlet is a Java-based program that runs on a web server. It handles client requests and generates dynamic web content. Servlets are an integral part of Java EE (Enterprise Edition) and are widely used for web development. HTTP GET Method The HTTP … Read more

How to get multiple parameters in ServletContext

index.html

web.xml

ServletContext.java

Results Read More How to access ServletContext parameters How to access ServletConfig initial parameter value

Employee Management System JSP Servlet Project

org. comp.model Employee Model – Employee.java

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

FetchEmployee.java

UpdateEmployee.java

showEmployee.java

DeleteEmployee.java

Data Access Object ConnectionFactory.java

EmployeeDAO.java

HTML Pages ListEmployees.jsp

AddEmployee.jsp

UpdateEmployee.jsp

menu.jsp

footer.jsp

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

Welcome.java

Servlet Welcome

Read more

Servlet Maven Configuration Example

Maven is the Project Management Tool, that helps developers to build the project easily (make create, add, update, compile, test, and deploy work easily).   You can download Maven from Official Site You can find the servlet dependency file here Technologies used here are as below Here we will start a new project with maven Select … 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

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

How to insert data in MySql Using JSP Servlet & JDBC

Here we will insert data in MySQL using JSP Servlet and JDBC. Here We will fetch Data from the JSP page and pass it to Servlet then DAO which contains JDBC code to store data in the MySQL database. How To Get Data From Database To Servlet Jdbc JSP Technology used Steps for Data insertion … Read more

How to access ServletContext parameters

index.html

web.xml

ServletContext.java

ServletContext1.java

Results

How to access ServletConfig initial parameter value

java servlet are executed when user request for some resource in server. ServletConfig is interface defined in javax.servlet package. ServletConfig is used to access servlet’s initial value stored in web.xml. For each servlet there is one ServletConfig. Initial value for servlet are stored in web.xml with name value pair as follows

initial parameter are … Read more