IT

@PathVariable 조건 다중 입력 값 설정 ||

agnusdei1207 2022. 7. 4. 16:48
반응형
SMALL
@RequestMapping(folderPath + "{proc:pop|modal}.do") 
public String pop(@ModelAttribute("searchVO") EmailVO searchVO, ModelMap model, HttpServletRequest request, @PathVariable String proc) throws Exception {

    String result = "";

    if("pop".equals(proc)){
        result = ".mPopLayout:/" + folderPath + proc;
    }else{    
        result = folderPath + proc; 
    } 

    return result; 
}

1. 단순히 변수로써 사용할 수도 있으나, || (or) 조건을 걸어 이처럼 유용하게 활용할 수 있다.

반응형
LIST