티스토리 뷰

Programming/Java

Spring MVC - JSTL Form

파란크리스마스 2016. 12. 4. 18:26
728x90

Spring MVC - JSTL Form radio 버튼

출처 : Spring MVC radiobutton and radiobuttons example

코드 객체 생성

package com.iot.db.domain;

public class CodeString {

	private String code;

	private String title;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

}

jsp

<form:select path="breed">
	<form:options items="${allBreeds}" itemValue="code" itemLabel="title" />
</form:select>

select option

<select id="cmb_code_type" style="height:35px" onchange="javascript:listCode(1);">
	<c:forEach var="code" items="${list_code_type}" varStatus="status">
		<option value="<c:out value="${code.id}"/>" index="${status.index}">
			<c:out value="${code.title}"/>
		</option>
	</c:forEach>
</select>
댓글
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
글 보관함