본문 바로가기
jsp spring maven

RequestMapping 동적 url

by [김경민]™ ┌(  ̄∇ ̄)┘™ 2013. 7. 31.
728x90

[출처] http://stackoverflow.com/questions/13366512/spring-mvc-dynamic-requestmapping

 

 

@RequestMapping(value="/category/{path}/**", method = RequestMethod.GET)
public void categoryTest(@PathVariable("path") String path, HttpServletRequest request) throws Exception {
    String remainingPaths = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
    logger.debug("path = " + path + "/" + remainingPaths);
}

 

728x90

'jsp spring maven' 카테고리의 다른 글

ArrayList 중복 카운트  (0) 2013.08.07
how to convert hash set to an arraylist  (0) 2013.08.06

댓글