Servlet Mapping example in deployment descriptor
This java server page (jsp) example shows how to redirect from a page another page in jsp, the request from jsp page will pass through a servlet and from the servlet to second . the following java code will decide which page the request should be directed : page.response.sendRedirect("secondPage.jsp");
web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Artificial intelligence</display-name>
<welcome-file-list>
<welcome-file>newPage.jsp</welcome-file>
</welcome-file-list>
<servlet>
<description>An example for servlet mapping in jsp servlet</description>
<display-name>Beyonce superbowl</display-name>
<servlet-name>Beyonce</servlet-name>
<servlet-class>com.NeuralNetwork.servlet.EvasiOn</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Beyonce</servlet-name>
<url-pattern>/NeuralNetwork.jsp</url-pattern>
</servlet-mapping>
</web-app>