Eclipse Maven springMVC项目。页面未加载显示错误页面未找到

Eclipse Maven springMVC项目。页面未加载显示错误页面未找到,eclipse,maven,jsp,spring-mvc,Eclipse,Maven,Jsp,Spring Mvc,我已经使用SpringMVC在eclipseide中用maven创建了一个项目。 没有maven的同一个项目运行得非常好,但是在使用maven项目创建它之后,我不确定出了什么问题。 在服务器上运行“我的项目”时显示“找不到错误页”。 我的代码如下所示 web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns

我已经使用
SpringMVC
在eclipseide中用maven创建了一个项目。 没有maven的同一个项目运行得非常好,但是在使用maven项目创建它之后,我不确定出了什么问题。
在服务器上运行“我的项目”时显示“找不到错误页”。
我的代码如下所示
web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>LoginMavenSpringMVC</display-name>
  <servlet>
     <servlet-name>spring-dispatcher</servlet-name>
     <servlet-class>
         org.springframework.web.servlet.DispatcherServlet
     </servlet-class>
 </servlet>
 <servlet-mapping>
     <servlet-name>spring-dispatcher</servlet-name>
     <url-pattern>/</url-pattern>
 </servlet-mapping>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:cache="http://www.springframework.org/schema/cache"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  http://www.springframework.org/schema/cache 
        http://www.springframework.org/schema/cache/spring-cache-3.2.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">


   <context:component-scan base-package="com.java.Package.Login"></context:component-scan>

   <mvc:annotation-driven/>
    <mvc:resources mapping="/resources/**" location="/resources/theme/" />

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">

        <property name="prefix">

            <value>/WEB-INF/views/</value>
        </property>
        <property name="suffix">
            <value>.jsp</value>
        </property>
    </bean>
   <mvc:resources mapping="/resources/**" location="/resources/theme/" />

</beans>  
    package com.java.Package.Login;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LoginController {

    @RequestMapping(value="/Login.html", method=RequestMethod.GET)

    public ModelAndView getLoginForm(){
        ModelAndView model = new ModelAndView("Login");
        System.out.println("working");
        return model;

    }
}  
我的项目结构


我错在哪里。。当我在服务器上运行它时,它说找不到页面。

您的web.xml中缺少下面的spring dispatcher

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:location_of_your_spring_conf_xml
            eg: /WEB-INF/spring/web-rest-config.xml         
            </param-value>
    </init-param>    
    <load-on-startup>1</load-on-startup>

org.springframework.web.context.ContextLoaderListener
上下文配置位置
类路径:您的spring配置xml的位置
例如:/WEB-INF/spring/WEB-rest-config.xml
1.

它的用途为了给出一个清晰的答案,绑定到该contextConfigLocation的xml中定义的SpringBean是一种让DispatchServlet知道SpringBean在其作用域中的内容的方法。