0

I am trying to delete an event from the table event but every time I click the button I get an error saying The Requested Resources Are Not Available. Here's my code:

<servlet-mapping>
    <servlet-name>Control_supprime_event</servlet-name>
    <url-pattern>/Control_supprime_event</url-pattern>
</servlet-mapping>

I checked the web.xml and it's working:

@WebServlet(urlPatterns = {"/Control_supprime_event"})

I used the annotation but nothing seems to work.

also i made sure the form action name is the same.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Iheb Amri
  • 3
  • 5
  • Edit : the Error i am getting is the requested ressources are not available .. – Iheb Amri Dec 10 '17 at 10:29
  • edit : for those who are facing the same problem my mistake was the slash '/' before the name of the servlet all you have to do is remove it exp "{"Control_supprime_event"}" and not {"/Control_supprime_event"} – Iheb Amri Jan 10 '18 at 08:19

1 Answers1

0
use E.g. @WebServlet("/path")}

This annotation is used to declare the configuration of an Servlet. 
If the name attribute is not defined, the fully qualified name of the class is used.

At least one URL pattern MUST be declared in either the value or urlPattern attribute of the annotation, but not both.

The value attribute is recommended for use when the URL pattern is the only attribute being set, otherwise the urlPattern attribute should be used.

The class on which this annotation is declared MUST extend HttpServlet. 

E.g. @WebServlet("/path")}
public class TestServlet extends HttpServlet ... {
E.g. @WebServlet(name="TestServlet", urlPatterns={"/path", "/alt"}) 
public class TestServlet extends HttpServlet ... {
i.karayel
  • 4,377
  • 2
  • 23
  • 27