org.springframework.web.servlet.PageNotFound noHandlerFound

时间:2015-12-10 06:05:03

标签: java spring spring-mvc

我正在尝试使用maven构建一个小型Spring Restful Web服务。我编写了我的代码,但不确定为什么它会抛出错误"找不到带有URI&#34的HTTP请求的映射。

我搜索过其他类似的stackoverflow链接,但没有运气。这就是我发布问题和代码的原因。

我将非常感谢你的帮助。

此致

Binoy

控制台日志:

Dec 10, 2015 11:12:22 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:RestfulWSInSpring' did not find a matching property.
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version:        Apache Tomcat/7.0.59
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built:          Jan 28 2015 15:51:10 UTC
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number:         7.0.59.0
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name:               Windows 8
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version:            6.2
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture:          amd64
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home:             C:\Program Files\Java\jre7
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version:           1.7.0_79-b15
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor:            Oracle Corporation
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE:         D:\Server\apache-tomcat-7.0.59
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME:         D:\Server\apache-tomcat-7.0.59
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=D:\Server\apache-tomcat-7.0.59
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=D:\Server\apache-tomcat-7.0.59
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=D:\Server\apache-tomcat-7.0.59\wtpwebapps
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=D:\Server\apache-tomcat-7.0.59\endorsed
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Dec 10, 2015 11:12:23 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files\Broadcom\Broadcom 802.11 Network Adapter;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Sony\VAIO Improvement;C:\Program Files (x86)\Sony\VAIO BIOS Data Transfer Utility\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Git\cmd;C:\apache-maven-3.3.9\bin;.
Dec 10, 2015 11:12:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8090"]
Dec 10, 2015 11:12:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Dec 10, 2015 11:12:23 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1248 ms
Dec 10, 2015 11:12:23 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Dec 10, 2015 11:12:23 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.59
Dec 10, 2015 11:12:25 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 10, 2015 11:12:25 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Dec 10, 2015 11:12:25 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Dec 10, 2015 11:12:25 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Thu Dec 10 11:12:25 IST 2015]; root of context hierarchy
Dec 10, 2015 11:12:26 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/RestfulWSInSpring-servlet.xml]
Dec 10, 2015 11:12:27 AM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 1312 ms
Dec 10, 2015 11:12:27 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [279] milliseconds.
Dec 10, 2015 11:12:27 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'RestfulWSInSpring'
Dec 10, 2015 11:12:27 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'RestfulWSInSpring': initialization started
Dec 10, 2015 11:12:27 AM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'RestfulWSInSpring-servlet': startup date [Thu Dec 10 11:12:27 IST 2015]; parent: Root WebApplicationContext
Dec 10, 2015 11:12:27 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/RestfulWSInSpring-servlet.xml]
Dec 10, 2015 11:12:27 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/greeting] onto handler 'grettingController'
Dec 10, 2015 11:12:27 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/greeting.*] onto handler 'grettingController'
Dec 10, 2015 11:12:27 AM org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping registerHandler
INFO: Mapped URL path [/greeting/] onto handler 'grettingController'
Dec 10, 2015 11:12:27 AM org.springframework.web.servlet.DispatcherServlet initServletBean
INFO: FrameworkServlet 'RestfulWSInSpring': initialization completed in 641 ms
Dec 10, 2015 11:12:28 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive D:\Server\apache-tomcat-7.0.59\webapps\BVAReport.war
Dec 10, 2015 11:12:31 AM org.apache.tiles.impl.BasicTilesContainer init
INFO: Initializing Tiles2 container. . .
Dec 10, 2015 11:12:31 AM org.apache.tiles.impl.BasicTilesContainer initializeDefinitionsFactory
INFO: Tiles2 container initialization complete.
Dec 10, 2015 11:12:31 AM org.apache.tiles.access.TilesAccess setContainer
INFO: Publishing TilesContext for context: org.apache.catalina.core.ApplicationContextFacade
Dec 10, 2015 11:12:32 AM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts-default.xml]
Dec 10, 2015 11:12:32 AM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts-plugin.xml]
Dec 10, 2015 11:12:32 AM com.opensymphony.xwork2.config.providers.XmlConfigurationProvider info
INFO: Parsing configuration file [struts.xml]
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ActionFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ResultFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ConverterFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.InterceptorFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.factory.ValidatorFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionFileProcessor)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterCreator)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterHolder)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper)
Dec 10, 2015 11:12:32 AM org.apache.struts2.config.AbstractBeanSelectionProvider info
INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser)
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive D:\Server\apache-tomcat-7.0.59\webapps\BVAReport.war has finished in 4,584 ms
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\cdn
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\cdn has finished in 166 ms
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\docs
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\docs has finished in 152 ms
Dec 10, 2015 11:12:32 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\examples
Dec 10, 2015 11:12:33 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 10, 2015 11:12:33 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 10, 2015 11:12:33 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@6bb4ab2b')
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\examples has finished in 761 ms
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\host-manager
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\host-manager has finished in 143 ms
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\manager
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\manager has finished in 114 ms
Dec 10, 2015 11:12:33 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\Server\apache-tomcat-7.0.59\webapps\ROOT
Dec 10, 2015 11:12:34 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory D:\Server\apache-tomcat-7.0.59\webapps\ROOT has finished in 105 ms
Dec 10, 2015 11:12:34 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8090"]
Dec 10, 2015 11:12:34 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Dec 10, 2015 11:12:34 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 10744 ms
Dec 10, 2015 11:12:38 AM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/RestfulWSInSpring/] in DispatcherServlet with name 'RestfulWSInSpring'

我的控制器类

package com.binoybaranwal.controller;

import java.util.concurrent.atomic.AtomicLong;

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.bind.annotation.RestController;

import com.binoybaranwal.Greeting;

@RestController
public class GrettingController {
    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();

    @RequestMapping(value = "/greeting", method=RequestMethod.GET)
    public Greeting greeting(@RequestParam(value="name", defaultValue="World", required=false) String name){
        return new Greeting(counter.incrementAndGet(), String.format(template, name));
    }

}

我的Pojo课程:

package com.binoybaranwal;

public class Greeting {
    private final long id;
    private final String content;

    public Greeting(long id, String content){
        this.id = id;
        this.content = content;
    }

    public long getId(){
        return this.id;
    }

    public String getContent(){
        return this.content;
    }

}

我的web.xml

<web-app id="WebApp_ID" version="2.4"
 xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


  <display-name>Archetype Created Web Application</display-name>

  <servlet>
    <servlet-name>RestfulWSInSpring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/RestfulWSInSpring-servlet.xml</param-value>       
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>RestfulWSInSpring</servlet-name>
    <url-pattern>*.jsp</url-pattern>
  </servlet-mapping>
</web-app>

我的spring配置文件RestfulWSInSpring-servlet.xml

<?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:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
    <context:component-scan base-package="com.binoybaranwal.*" />
    <tx:annotation-driven />

</beans>

我的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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.binoybaranwal</groupId>
    <artifactId>RestfulWSInSpring</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>RestfulWSInSpring Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <properties>
         <spring.version>4.2.3.RELEASE</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>   
        <!-- Spring dependencies -->
      <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-core</artifactId>
       <version>${spring.version}</version>
     </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring.version}</version>
    </dependency>

    <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
       <version>${spring.version}</version>
    </dependency>

    <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-tx</artifactId>
       <version>${spring.version}</version>
    </dependency>

    </dependencies>
    <build>
        <finalName>RestfulWSInSpring</finalName>

    </build>    
</project>

1 个答案:

答案 0 :(得分:0)

web.xml 文件中修改std::vector<std::vector<int>>的{​​{1}},如下所示:

servlet-mapping

RestfulWSInSpring-servlet.xml 文件中添加RestfulWSInSpring,如下所示:

<servlet-mapping>
    <servlet-name>RestfulWSInSpring</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>