我的Tomcat没有运行我的项目,只是我的项目的URL名称被交换为[/ 7Bproject.name $%% 7D-0.0.1-SNAPSHOT /]
。甚至直接访问我的项目的URL它不会运行。
我也在使用eclipse。
我的控制台上返回的错误消息是:
Jun 09, 2014 12:00:22 PM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/ 7Bproject.name $%% 7D-0.0.1-SNAPSHOT /] in DispatcherServlet with name 'Spring MVC Dispatcher Servlet'
我的web.xml很好:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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">
<display-name>upload-videos</display-name>
<!-- DEFAULT PAGE -->
<welcome-file-list>
<welcome-file>views/index.jsp</welcome-file>
</welcome-file-list>
<!-- SPRING MVC -->
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-mvc-context.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.maycon</groupId>
<artifactId>upload-videos</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<!-- PROPRIEDADES DO PROJETO -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>4.0.5.RELEASE</spring.version>
</properties>
<!-- REPOSITÓRIOS -->
<repositories>
<!-- SPRING REPOSITORY -->
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>EBR Spring Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/release </url>
</repository>
<!-- SPRING REPOSITORY -->
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>EBR External Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/external </url>
</repository>
<!-- ZENCODER REPOSITORY -->
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<!-- DEPENDÊNCIAS -->
<dependencies>
<!-- JAVAEE WEB API -->
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<!-- SERVLET-API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<!-- JSP-API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
</dependency>
<!-- SPRING WEB MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- SPRING CONTEXT -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- SPRING CORE -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- AMAZON AWS SDK -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.7.12</version>
</dependency>
<!-- FILE UPLOAD -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>
<!-- ZENCODER -->
<dependency>
<groupId>com.brightcove.zencoder.api</groupId>
<artifactId>zencoder-java</artifactId>
<version>2.0.15</version>
</dependency>
</dependencies>
<!-- CONFIGURAÇÕES DE CONSTRUÇÃO DO PROJETO -->
<build>
<!-- NOME FINAL DO PROJETO -->
<finalName>${project.name}-${project.version}</finalName>
<!-- PLUGINS -->
<plugins>
<!-- VERSÃO DO COMPILADOR DO MAVEN -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
<!-- RECURSOS -->
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
答案 0 :(得分:0)
您是否提供了所需的请求映射,还验证了您的上下文根以访问应用程序