티스토리 뷰

Programming/Java

jstl

파란크리스마스 2012. 10. 28. 09:49
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 -

댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함