In servlet3.0 how configuration 404 page, not use the web.xml. Check Solution. To not use the web.xml, you would have to use annotations. So where would you put the annotation to define an error page?How can a servlet ascertain if a file has been fully downloaded by a client PostBack on Servlet or JSP Check for Asynchronous request Change in request parameter value Generally, I would prefer to use a configuration option e.g. in web.xml. This is supported via a Servlet 3.0 web.xml (see web-common30.xsd)Specifies whether any session tracking cookies created. by this web application will be marked as HttpOnly Just remove all elements from your web.xml and the configuration will be properly applied to all requests.Now in Servlet 3.0 the element can be used to ensure that the JSESSIONID is not transmitted over plain old HTTP. Lets configure the deployment descriptor file. web.xml.Based on above configuration, if the application throws 404 error, 403 error or any kind of exception then it will be handled by ExceptionHandler servlet.
As I sometimes need these, I have compiled a list of the valid headers of the web.xml and web-fragment.xml file for servlet version 2.
3 until 3.0. Maybe you find them as handy as I do. The configurations we used to do in web.xml, can now be alternatively done by using annotations. Now, we can have Servlet, Filter and ServletContextListener without web.xml.MultipartConfig. . The servlet is configured in web.xml. Configure Servlet 3 web.xml You must register your servlet with servlet container using the tag and the . The tag include the full path of java class and servlet name that you want to map. Configure the Servlet URL mapping in "web.xml".ServletContext context config.getServletContext() context.setAttribute("databaseURL", config.getInitParameterServlets 3.0 "web.xml" Syntax.