Java Servlet JSON Response in JSP using Gson

In Modern web application We get data from 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 for mobile app development. Here we will see how we can get JSON Response from servlet and show in jsp. What is … Read more

ServletConfig to access multiple initial parameter value

index.html

web.xml

ServletConfigMulParam

Result

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

Welcome.java

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