java 소스
==================================================================================================================
import java.util.ArrayList;
import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import common.Constants;
import common.component.IComponent;
import common.util.HttpUtil;
import db.Dao;
public class CompanyInfoSearch implements IComponent{
private String forward유알엘 = null;
public CompanyInfoSearch(){}
public CompanyInfoSearch(String forwar유알엘l){
this.forward유알엘 = forward유알엘;
}
public String doComponent(HttpServletRequest req, HttpServletResponse res)throws Exception {
HttpSession session = null;
String cpId = null;
try{
System.out.println(\"\");
session = req.getSession();
cpId = (String)session.getAttribute(Constants.LOGIN_ID);
if(cpId == null || cpId.length() == 0){
req.setAttribute(\"url\", this.forward유알엘);
return Constants.HOMEPAGE_LOGIN_PAGE;
}
long rownum = 0;
int rowCount = 10;
int navigatorCount = 10;
int currentPage = 1;
HashMap<String, Object> parameter = new HashMap<String, Object>();
parameter.put(\"cpId\", cpId);
parameter.put(\"searchItem\", HttpUtil.getParameter(req, \"companyInfoSearchItem\"));
parameter.put(\"searchKeyword\", HttpUtil.getParameter(req, \"companyInfoSearchKeyword\"));
parameter.put(\"typeOfBusiness\", req.getParameterValues(\"typeOfBusiness\"));
parameter.put(\"companyType\", req.getParameterValues(\"companyType\"));
parameter.put(\"establishDate\", req.getParameterValues(\"establishDate\"));
parameter.put(\"employeeCnt\", req.getParameterValues(\"employeeCnt\"));
parameter.put(\"rowCount\", rowCount);
parameter.put(\"currentPage\", HttpUtil.getParameter(req, \"companyInfoCurrentPage\"));
Integer maxNoInteger = (Integer)Dao.selectForObject(\"cp.companyInfoTableSelectForMaxNo\", parameter);
int maxNo = maxNoInteger.intValue();
if(HttpUtil.getParameterIntValue(req, \"companyInfoRownum\") == 0)
parameter.put(\"rownum\", maxNo);
else
parameter.put(\"rownum\", HttpUtil.getParameterIntValue(req, \"companyInfoRownum\"));
ArrayList<HashMap<String, Object>> companyInfoList = (ArrayList<HashMap<String, Object>>)Dao.selectForList(\"cp.companyInfoTableSelectForBoard\", parameter);
req.setAttribute(\"companyInfoList\", companyInfoList);
req.setAttribute(\"companyInfoMaxNo\", maxNo);
req.setAttribute(\"companyInfoCurrentPage\", HttpUtil.getParameterIntValue(req, \"companyInfoCurrentPage\"));
req.setAttribute(\"companyInfoSearchItem\", parameter.get(\"searchItem\"));
req.setAttribute(\"companyInfoSearchKeyword\", parameter.get(\"searchKeyword\"));
req.setAttribute(\"typeOfBusiness\", req.getParameterValues(\"typeOfBusiness\"));
req.setAttribute(\"companyType\", req.getParameterValues(\"companyType\"));
req.setAttribute(\"establishDate\", req.getParameterValues(\"establishDate\"));
req.setAttribute(\"employeeCnt\", req.getParameterValues(\"employeeCnt\"));
} catch(Exception ex){
throw ex;
}
return this.forward유알엘l;
}
}
==================================================================================================================
jsp 소스
==================================================================================================================
<table width=\"100%\" class=\"\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td colspan=\"2\" height=\"1\" style=\"padding:0;\" bgcolor=\"#E9E9E9\">
<table width=\"770px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<th >업 종 :</th>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"1\" >서비스·교육·금융·유통 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"2\" />미디어·광고·문화·예술 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"3\" />IT·정보통신 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"4\" />제조·통신·화학·건설 </td>
<td colspan=\"2\"> </td>
<tr>
<tr>
<th >기업유형 :</th>
<td><input type=\"checkbox\" name=\"companyType\" value=\"대기업\" />대기업</td>
<td><input type=\"checkbox\" name=\"companyType\" value=\"공기업\" />공기업</td>
<td><input type=\"checkbox\" name=\"companyType\" value=\"코스닥등록\" />코스닥등록</td>
<td><input type=\"checkbox\" name=\"companyType\" value=\"외국계\" />외국계</td>
<td><input type=\"checkbox\" name=\"companyType\" value=\"일반기업\" />일반기업</td>
<td> </td>
</tr>
<tr>
<th >설립년수 : </th>
<td><input type=\"checkbox\" name=\"establishDate\" value=\"1\" />5년 미만</td>
<td><input type=\"checkbox\" name=\"establishDate\" value=\"2\" />5~9년</td>
<td><input type=\"checkbox\" name=\"establishDate\" value=\"3\" />10~19년</td>
<td><input type=\"checkbox\" name=\"establishDate\" value=\"4\" />20~29년</td>
<td><input type=\"checkbox\" name=\"establishDate\" value=\"5\" />30년 이상</td>
<td> </td>
</tr>
<tr>
<th >임직원수 : </th>
<td><input type=\"checkbox\" name=\"employeeCnt\" value=\"1\" />10명 미만 </td>
<td><input type=\"checkbox\" name=\"employeeCnt\" value=\"2\" />11~19명</td>
<td><input type=\"checkbox\" name=\"employeeCnt\" value=\"3\" />20~49명</td>
<td><input type=\"checkbox\" name=\"employeeCnt\" value=\"4\" />50~99명</td>
<td><input type=\"checkbox\" name=\"employeeCnt\" value=\"5\" />100명 이상</td>
<td>
<a href=\":search()\">
<img src=\"/cp_potal/images/menu/util/serch_button.gif\" alt=\"검색\">
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
==================================================================================================================
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"1\" >서비스·교육·금융·유통 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"2\" />미디어·광고·문화·예술 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"3\" />IT·정보통신 </td>
<td><input type=\"checkbox\" name=\"typeOfBusiness\" value=\"4\" />제조·통신·화학·건설 </td>
같은 name의 체크박스 체크한 것들을 getParameterValues로 받아와서 처리하고
다시 jsp로 체크했던 체크박스를 자동으로 체크해줘야하는데( 체크박스 체크상태 유지) jsp 에서 어떻게 받아서 처리해할지 모르겠어요.ㅜㅜ
도움좀 부탁드릴게요. ㅜㅜ
url이 금지어였다니
염불떈쓰 춘거 인증하면
url 금지어 인거 알게 됬잖아 형들.ㅜㅜ 도움좀 부탁해요