I’m trying to run this code using tomcat in eclipse
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="serv">
<input type="submit">
</form>
</body>
</html>
When I click on submit button, the following error message appears
HTTP Status 404 - /Ajax/serv
type Status report
message /Ajax/serv
description The requested resource (/Ajax/serv) is not available.
I was working on a JSP project without any problems, until I removed the JSP and Servers projects and created new ones. Since then, it’s not working.
Any suggestions please?
Make sure that your servlet class is inside a package and has the
@WebServletannotation with an URL pattern of at least/serv.The URL pattern can also be
/serv/*depending on whether you’d like to support path info or not.If your servlet class already has one, then something failed during servlet’s construction or initialization. Detailed information about that should be available in the server’s logs which you can find in Eclipse’s console.