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

Submitting data to servlet using http post

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

Register.java

Request dispatcher in Servlet User Login Example

Request dispatcher in Servlet is one of the important topics here we explained it using the User login example. In Java Servlets, a RequestDispatcher is an interface provided by the Servlet API that allows you to forward or include a request or response from one servlet to another servlet, JSP (JavaServer Pages), or any other … Read more

Getting parameter values in Servlet getParameterNames

Project Explorer : index.jsp

ParameterValues.java

pom.xml

Result

How to do pagination in JSP with Servlet JDBC and MYSQL

How to do pagination in JSP is very interesting concept let see step by step. What is Pagination? Pagination in programming refers to dividing an extensive data set into smaller, more manageable chunks called pages. It is commonly used when working with databases or APIs to efficiently handle large amounts of information. Advantages of Pagination? … Read more

Showing all request header in servlet

This tutorial will find the read request header name and values in the servlet. There are many requests headers present like: host, connection, user-agent, cookie, etc. In the below project, we read the request project header names and values. Technology User apache-tomcat-9.0.71javaee-web-api 7.0 Java 1.8 Steps to develop this project Create a Java with Maven … 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

web.xml

Welcome1.java

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: