码迷,mamicode.com
首页 > Web开发 > 详细

sprinvMVC路径拦截

时间:2016-03-17 14:42:49      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

关于这种路径的拦截:

http://localhost:8080/moodleCourse-tool/scorm/23681/mod_scorm/content/1/index_SCORM.html

一、用servlet,web.xml中<url-pattern>/</url-pattern>

二、用springmvc的动态url

@RequestMapping("/{contextid}/{component}/{filearea}/1/{filename}")
//    @RequestMapping
    public void player(@PathVariable String contextid,@PathVariable String component,
            @PathVariable String filearea,@PathVariable String filename,HttpServletRequest request,
            HttpServletResponse response){

三、用springmvc的url

@Controller
@RequestMapping("/scorm")
public class ScormController{
    
    @Autowired
    private ScormScoesService scormScoesService;
    
    @RequestMapping("/**")
    public void player(HttpServletRequest request,HttpServletResponse response){
        

两个*拦截即可。

sprinvMVC路径拦截

标签:

原文地址:http://www.cnblogs.com/zrui-xyu/p/5287002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!