from the idea, the project works fine, if I upload the project to the root of the tomket also works fine, but if the deployment from the tomkote project manager and launch the application at localhost: 8080 / app , then when going to the second page localhost: 8080 / app / second_page an error occurs .
On the first page there is a form:
<form onsubmit="return checkForm(this)" action="/second_page" method="POST"> <div id="fields_container"> <div> <div class="element">First name:</div> <input id="name" type="text" name="firstName"/> <span id="err_name" class="error"></span> </div> </div> <div> <input type="submit" value="Submit"> </div> </form> при нажатии на "submit" приложение перебрасывает не на **localhost:8080/app/second_page** а на **localhost:8080/second_page**my web.xml
<servlet> <servlet-name>addServlet</servlet-name> <servlet-class>com.company.MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>addServlet</servlet-name> <url-pattern>/second_page</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/WEB-INF/pages/index.jsp</welcome-file> </welcome-file-list> <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/WEB-INF/pages/error.jsp</location> How can I solve this problem. Thank.
WEB-INF/lib) or place it in the server's shared library folder ($CATALINA_BASE/libor$CATALINA_HOME/lib?). It’s hard to come up with another reason if everything else is right. In general, as stated in the comments above, an error in the studio. - Sergeyaction="/second_page", which meanslocalhost:8080/second_page. Must beaction="${request.contextPath}/second_page". All absolute links (starting with/) to the application pages should be of such a kind as to make them independent of the currentcontext root. Another option is to use relative links (should not begin with/). If the page is in the same directory, thenaction="second_page", if in a neighbor, thenaction="second_folder/second_page", in parentaction="../second_page"- Sergey