폼빈에 배열을 사용하기
public class Select extends ActionForm {
String[] mpart = {};
public String[] getMpart() {
return mpart;
}
public void setMpart(String[] mpart) {
this.mpart = mpart;
}
}
* jsp 에서 보내는 방식(한가지 선택)
1. List 방식: 드래그 지원
<html:select multiple="true" property="mpart" size="5">
<html:option value="1">Choice 1</html:option>
<html:option value="2">Choice 2</html:option>
<html:option value="3">Choice 3</html:option>
</html:select>
2. Check Box 방식
<html:multibox property="mpart" value="1"/>Choice 1
<html:multibox property="mpart" value="2"/>Choice 2
<html:multibox property="mpart" value="3"/>Choice 3
3. Menu 방식
<html:select multiple="true" property="mpart">
<html:option value="1">Choice 1</html:option>
<html:option value="2">Choice 2</html:option>
<html:option value="3">Choice 3</html:option>
</html:select>
* Action 에서 받는 형식
Select s = (Select )form;
for ( int i=0;i<s.getMpart.length;i++) {
System.out.println("Request Value Mpart"+i+" : "+s.getMpart[i]);
}
public class Select extends ActionForm {
String[] mpart = {};
public String[] getMpart() {
return mpart;
}
public void setMpart(String[] mpart) {
this.mpart = mpart;
}
}
* jsp 에서 보내는 방식(한가지 선택)
1. List 방식: 드래그 지원
<html:select multiple="true" property="mpart" size="5">
<html:option value="1">Choice 1</html:option>
<html:option value="2">Choice 2</html:option>
<html:option value="3">Choice 3</html:option>
</html:select>
2. Check Box 방식
<html:multibox property="mpart" value="1"/>Choice 1
<html:multibox property="mpart" value="2"/>Choice 2
<html:multibox property="mpart" value="3"/>Choice 3
3. Menu 방식
<html:select multiple="true" property="mpart">
<html:option value="1">Choice 1</html:option>
<html:option value="2">Choice 2</html:option>
<html:option value="3">Choice 3</html:option>
</html:select>
* Action 에서 받는 형식
Select s = (Select )form;
for ( int i=0;i<s.getMpart.length;i++) {
System.out.println("Request Value Mpart"+i+" : "+s.getMpart[i]);
}