1
votes

I have included a library in my webapp. This library has its own web.xml. When I deploy the project on jetty, I find that the servlets from the library are not loaded. I have to manually add these servlets into the web.xml of my project. Is it possible to include these servlets in my project without me having to enter them all in my web.xml

If additional information regarding my problem is required, I would be happy to provide it.

1

1 Answers

0
votes

you have to tell the servlet container that it has to initialize a sevlet. The usually way is to use the deployment descriptor (web.xml). Since JEE6 there is another option with annotations:

@WebServlet(urlPatterns="/forward")
public class ForwardServlet extends HttpServlet {
  //code goes here...
}

But you'll have to try it, if it works with servlets inside a referenced library.