首页 > Web开发 > 详细

sprinvMVC路径拦截

时间:2016-03-17 14:41:49      阅读:258      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!