无法使用Spring MVC调用简单Rest客户端

无法使用Spring MVC调用简单Rest客户端,spring,rest,Spring,Rest,我正在使用Spring MVC3.1构建一个项目,在我的项目中我正在实现restful资源的使用。为此,我下载了Google Chrome Web浏览器的“Simple Rest Client”扩展。但是每当我试图从客户端发送数据时,我都会收到错误“404 Not Found”。下面是我的控制器类,名为“BookRestController.java” 这是我的web.xml文件 <?xml version="1.0" encoding="UTF-8"?> <web-a

我正在使用Spring MVC3.1构建一个项目,在我的项目中我正在实现restful资源的使用。为此,我下载了Google Chrome Web浏览器的“Simple Rest Client”扩展。但是每当我试图从客户端发送数据时,我都会收到错误“404 Not Found”。下面是我的控制器类,名为“BookRestController.java”

这是我的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">
  <welcome-file-list>
     <welcome-file>index.html</welcome-file>    
  </welcome-file-list>
 <session-config>
   <session-timeout>
       30
   </session-timeout>
 </session-config>
 <servlet>
   <servlet-name>bsm</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
   <servlet-name>bsm</servlet-name>
   <url-pattern>/</url-pattern>
 </servlet-mapping>
 <filter>
   <filter-name>springSecurityFilterChain</filter-name>
   <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
 </filter>
 <filter-mapping>
   <filter-name>springSecurityFilterChain</filter-name>
   <url-pattern>/*</url-pattern>
 </filter-mapping>
<listener>
   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <context-param>
    <param-name>contextConfigLocation</param-name>
   <param-value>
      /WEB-INF/bsm-servlet.xml
      /WEB-INF/spring-security.xml
   </param-value>
 </context-param>
<context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
  <param-value>com.edifixio.bsm.resource.Label</param-value>
</context-param>
 </web-app>

有谁能给我一个合适的解决方案吗?

我正在使用JBoss7而不是Tomcat找出你的应用程序的上下文根是什么。是不是
书店维护战
  <?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">
  <welcome-file-list>
     <welcome-file>index.html</welcome-file>    
  </welcome-file-list>
 <session-config>
   <session-timeout>
       30
   </session-timeout>
 </session-config>
 <servlet>
   <servlet-name>bsm</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
   <servlet-name>bsm</servlet-name>
   <url-pattern>/</url-pattern>
 </servlet-mapping>
 <filter>
   <filter-name>springSecurityFilterChain</filter-name>
   <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
 </filter>
 <filter-mapping>
   <filter-name>springSecurityFilterChain</filter-name>
   <url-pattern>/*</url-pattern>
 </filter-mapping>
<listener>
   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <context-param>
    <param-name>contextConfigLocation</param-name>
   <param-value>
      /WEB-INF/bsm-servlet.xml
      /WEB-INF/spring-security.xml
   </param-value>
 </context-param>
<context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
  <param-value>com.edifixio.bsm.resource.Label</param-value>
</context-param>
 </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:mvc="http://www.springframework.org/schema/mvc"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:p="http://www.springframework.org/schema/p"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="http://www.springframework.org/schema/mvc
 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-3.1.xsd">

 <context:component-scan base-package="com.edifixio.bsm"/>

 <bean class="com.edifixio.bsm.validator.BookValidator"/>
 <bean class="com.edifixio.bsm.validator.SystemUserValidator"/> 

 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"
   p:viewClass="org.springframework.web.servlet.view.JstlView"
   p:prefix="/WEB-INF/pages/"
   p:suffix=".jsp"/>

   <bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
    p:location="/WEB-INF/data_resources/jdbc_info.properties" />

   <bean id="dataSource"
     class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"
     p:driverClassName="${JDBC_DRIVERCLASS_NAME}"
     p:url="${JDBC_URL}" p:username="${JDBC_USER_NAME}"
     p:password="${JDBC_PASSWORD}"/>

     <bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation">
        <value>/WEB-INF/data_resources/hibernate.cfg.xml</value>
        </property>

      <property name="hibernateProperties">
          <props>
            <prop key="hibernate.dialect">${JDBC_DIALECT}</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.hbm2ddl.auto">update</prop>
         </props>
      </property>
   </bean>


   <bean id="transactionManager"
       class="org.springframework.orm.hibernate4.HibernateTransactionManager">
      <property name="sessionFactory" ref="sessionFactory" />
    </bean>

   <tx:annotation-driven transaction-manager="transactionManager"/>

  <bean id="transactionInterceptor" abstract="true"       class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager" ref="transactionManager"/>
   <property name="transactionAttributeSource">
     <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
    </property>
 </bean>
 </beans>
  http://localhost:8087/BookShopMaintanance-war/services/book