프로그램 언어/Spring

Spring에서 배열 파라미터를 Bean으로 받는 방법

[식군] 2010. 2. 20. 20:47
1. jsp
<form:form commandName="voBean" name="formName" method="post">
<input type="hidden" name="param" />
<input type="hidden" name="param" />
<input type="hidden" name="param" />
..
..
..
</form:form>


2. controller
 @RequestMapping(value="....")
    public String goMainScreen(@ModelAttribute("voBean") VOBean VOBean, WebRequest ServletRequest)
            throws Exception {

            .....
            .....
            .....
            .....
}

3. VO Bean

public class VOBean {

String[] param;
.....
.....

getter, setter
.....
.....

}