The app welcome page is running however when I'm clicking on hyperlink it shows an error:
Type Status: Report
Message: /Welcome/nextPage
Description: The origin server did not find a current representation for the target resource or is not willing
My guess it is something to do with the web.xml file. One of my attemps was to write the following:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1">
<display-name>MyApp</display-name>
<welcome-file-list>
<welcome-file>WelcomeServlet</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>NextPageServlent</servlet-name>
<jsp-file>/NextPageServlent/nextPage.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>NextPageServlent</servlet-name>
<url-pattern>/NextPageServlent/*</url-pattern>
</servlet-mapping>
</web-app>
However it doesn't help, I have the same problem
edit: hyperlink that leads to 'nextPage'
index.jsp:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%
String table=(String) request.getAttribute("table");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>table content</title>
</head>
<body>
<h1>table content</h1>
<p>
<a href="nextPage">go to the next page </a>
</p>
<%= table %>
</body>
</html>
the web page link: http://localhost:8080/Welcome/nextPage
Is there a way not to use web.xml file?