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

Servlet Annotation WebServlet Example

First example to show Servlet Welcome. For this we have created index.html page on index.html we have created a link. on click at link it will call welcome servlet. Our project directory structure is as below index.jsp

@WebServlet(name = “Welcome”, urlPatterns = {“/welcome”}) here urlPattern maps /welcome to <a href=”welcome”>Show welcome … Read more