I have a plugin project where I want to implement some servlets with jetyy. I have a login.html with this structure:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>LOGIN.HTML</title>
</head>
<body>
<h1>LOGIN</h1>
<form method='POST' action=''>
User: <input type="text"> <br />
Password: <input type="password"> <br />
<input type="submit" value="login">
</form>
</body>
</html>
After I submit the form, I want to call a servlet to do some actions... This is the servlet:
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/receptor")
public class HelloServlet extends HttpServlet
{
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
}
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
System.out.println("TEST");
}
}
But I can't call it, I always have the 404 not found error, what's the right thing to write on the action of the form ?
PS: I've tried to create the WEB-INF structure and the web.xml, but I always got bad configuration error of this web.xml .. Is it possible to call the servlet without web.xml ?