There is a servlet that responds to root requests:

<servlet> <servlet-name>SignInServlet</servlet-name> <servlet-class>ru.pravvich.servlets.SignInServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>SignInServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> 

And there is a form which, through doPost, refers to it:

 <form action="" method="post"> <input type="submit" value="Меню"> </form> 

But when the transition to the URL page in the address bar does not change.

It was like http://localhost:8080/items/answer so it remains after the transition, but I need to cut off the path to http://localhost:8080/items/ . Tell me how can I solve this problem?

  • one
    action = "# {request.contextPath} /" or action = "# {pageContext.request.contextPath} /" - Sergey
  • <form action=".." method="post"> ? - Qwertiy
  • one
    if jstl connected jstl specify: action="<c:url value="/" />" - MrFylypenko

0