Member 라는 beans 클래스다. Colored By Color Scripter™ 1 2 3 4 5 6 7 8 9 10 11 12 public class Member { private String id; private String pw; private String name; private int sex; // 0이면 여자 1이면 남자 private String mobile; private String email; private int dept_code; // .. getter, setter method .. } sex 속성은 int로 정의되어있다. 다음은, 회원가입 view의 form 코드 Colored By Color Scripter™ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1..
spring mvc / jsp 사용 Colored By Color Scripter™ 1 2 3 4 5 6 7 8 9 10 11 ▲ select box에 change 메소드를 추가. 선택한 값이 변할때마다, input#dept_code에 선택된 학과 코드가 입력된다. input#dept_code은 hidden type으로, 컨트롤러에 값을 전하고, 다시 전달받는다. Colored By Color Scripter™ 1 2 3 4 5 6 7 8 9 10 11 학과를 선택하세요 ${ dept.department_name } ▲ select box와 input 컨트롤러에서 전달받은 dept_code (이전 화면에서 선택됬던 값)와 현재 option의 dept_code 값을 비교하여 일치하는 경우 selected ..