<form action=/MVC2/MemberSelectController>
<select name="ch1">
<option value="custname">이름</option>
<option value="address">주소</option>
</select>
<input type="text" name="ch2">
<input type="submit" value="검색하기">
</form>
String ch1 =
request.getParameter("ch1");
String ch2 = request.getParameter("ch2");
m.setCh1(ch1);
m.setCh2(ch2);
System.out.println(m.getCh1());
System.out.println(m.getCh2());
String ch1 = m.getCh1();
String ch2 = m.getCh2();
if(m.getCh1() == null || m.getCh2() == "") {
sql = "select * from member_tbl_02";
}else {
if(ch1.equals("custname")) {
sql = "select * from member_tbl_02 where custname like '%"+ch2+"%' ";
}else {
sql = "select * from member_tbl_02 where address like '%"+ch2+"%' ";
}
}