为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

weixin_慕容6518710 2016-04-17 12:27:35
//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; }
查看完整描述

1 回答

?
Its_forever

TA贡献361条经验 获得超328个赞

是不是springmvc.xml文件没有加自动扫描的包。

查看完整回答
反对 回复 2016-04-17
  • 1 回答
  • 0 关注
  • 1388 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信