404问题,spring mvc,求大神帮助。

//web.xml(部分代码)
	 <filter>
    	<filter-name>login</filter-name>
    	<filter-class>org.example.shop.filter.LoginFilter</filter-class>
    </filter>
    <filter>
    	<filter-name>main</filter-name>
    	<filter-class>org.example.shop.filter.MainFilter</filter-class>
    </filter>
    <filter-mapping>
    	<filter-name>login</filter-name>
    	<url-pattern>/jsp/index.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    	<filter-name>main</filter-name>
    	<url-pattern>/jsp/main/*</url-pattern>
    </filter-mapping>
	<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
	<servlet>
	    <servlet-name>spring</servlet-name>
	    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
	    <load-on-startup>1</load-on-startup>
    </servlet>
  <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>SafeCode</servlet-name>
    <servlet-class>org.example.shop.util.SafeCode</servlet-class>
  </servlet>
   <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>SafeCode</servlet-name>
    <url-pattern>/safecod</url-pattern>
  </servlet-mapping>
  
  //list.jsp(部分代码)
<td>
  <form action="../../deletegood.do" method="post">
        <input type="hidden" name="name" value= '${item.name}'/>
        <input type="hidden" name="type" value= '${item.type}'/>
        <input type="submit" value="delete" class="deletegood"/>
  </form>
</td>

//controller(部分代码)
@RequestMapping("/deletegood")
	public String deleteGoodsBuName(HttpServletRequest request,@RequestParam("name") String name,@RequestParam("type") String type){
		System.out.println("1111111111111111");
		goodService.deleteGoodsByName(name);
		goodService.findGoodsByType(request, type);
		return "redirect:jsp/main/list.jsp?type="+type;
}


weixin_慕容6518710
浏览 1389回答 1
1回答

Its_forever

是不是springmvc.xml文件没有加自动扫描的包。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java