For some reason idea lights dispatcher servlet and when I launch tomcat get the 404 error. I`m using spring mvc and Maven, here is the picture of web.xml Appreciate every answer=) webapp/web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Found the problem, was using the tomcat7-maven-plugin
with compile version of maven-compiler-plugin
1.8, after changing it to 1.7 the problem gone.
However is there any similar solutions to tomcat7-maven-plugin
?, cause I didnt find tomcat8-maven-plugin
in internet
Thanks everyone for participation
Open settings below:
Project settings -> Facets -> Web -> Deployment Descriptors
check the path here and ensure it's available. If not, click the green + to add your web module path.
You need to add servlet mapping also and then add spring-webmvc-version.jar
in classpath
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With