I have a servlet called User.java. It maps to a URL pattern
<servlet-mapping>
<servlet-name>User</servlet-name>
<url-pattern>/user/*</url-pattern>
</servlet-mapping>
Inside the servlet, the path following the slash is analyzed user/, the data about this user is extracted from the database, set in the attributes, and then the page is displayed user_home.jsp. Code for this:
User user = UserManager.getUserInfoById(userPath);
request.getSession().setAttribute("user", user);
request.getRequestDispatcher("resources/jsp/user_home.jsp").forward(request, response);
The problem is that instead of opening this, the user_home.jsprequest is again mapped to the same servlet User.java. He does not do anything.
I put the output statements at the beginning of the method doGet, so I see that the URL
http://localhost:8080/myproj/user/resources/jsp/user_home.jsp
therefore, it seems an obvious problem that it will return to the template user/*.
, URL-, jsp ?