728x90
출처 : Spring MVC Checkbox And Checkboxes Example
CodeData.java
public class CodeData { private int itemValue; private String itemLabel; public CodeData(int itemValue, String itemLabel) { super(); this.itemValue = itemValue; this.itemLabel = itemLabel; } public int getItemValue() { return itemValue; } public void setItemValue(int itemValue) { this.itemValue = itemValue; } public String getItemLabel() { return itemLabel; } public void setItemLabel(String itemLabel) { this.itemLabel = itemLabel; } }
라디오버튼
List<CODEDATA> typeList = new ArrayList<CODEDATA>(); typeList.add(new CodeData(1, "남자")); typeList.add(new CodeData(2, "여자")); modelMap.addObject("typeList", typeList);
<form:radiobuttons path="gender" items="${typeList}" itemValue="itemValue" itemLabel="itemLabel"/>
셀렉트박스
<form:select path="template_id" style="width: 200px; display:none"> <form:options items="${listTemplate}" itemLabel="name" itemValue="tid" /> </form:select>
form action url
출처 : Spring MVC: Relative URL problems<spring:url var = "action" value='/ruleManagement/save' ... /> <form:form action="${action}" method="post">
- end -
728x90