Help me to understand. Through servlet pictures do not open. Yesterday, all the same thing worked now I do not understand what the problem is.

protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet Servlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet Servlet at " + request.getContextPath() + "</h1>"); out.println("<img src=\"images/rr.jpg\"/>"); out.println("</body>"); out.println("</html>"); } } 

web.xml

 <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"> <servlet> <servlet-name>Servlet</servlet-name> <servlet-class>servlets.Servlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> </web-app> 

    1 answer 1

    Almost 2 days could not enter.

     <url-pattern>/</url-pattern> servlet не видит файлы в pages || web <url-pattern>/</Servlet(или другое ...)url-pattern> все ок. 

    I did not think that this is so affected.