【文件属性】:
文件名称:dwr验证框架多级联下拉菜单
文件大小:11KB
文件格式:TXT
更新时间:2011-10-10 02:06:05
dwr验证框架多级联下拉菜单
index.jsp(级联的重点)
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage=""%>
<%
ResultSet rs_city = null;
ResultSet rs_Town = null;
ResultSet rs_province = null;
String sql = "";
String sql_T = "";
int SelectID_C = 0;
int SelectID_P=0;
String strCityID1=request.getParameter("CityID");
String strSelectID_P=request.getParameter("ProvinceID");
if (strSelectID_P!=null &&!strSelectID_P.equals("")) {
session.setAttribute("SelectID_P", strSelectID_P);
}
String sql_P = "SELECT * FROM tb_Area WHERE TypeID=1 or TypeID=4 or TypeID=5";
try {
rs_province = connDB.executeQuery(sql_P);
if (rs_province.next()) {
if(session.getAttribute("SelectID_P")!=null){
SelectID_P= Integer.parseInt((String)session.getAttribute("SelectID_P"));
}else{
SelectID_P=rs_province.getInt("ID");
}
%>
级联菜单
<%
}
} catch (Exception e) {
System.out.println("查询省级名称时出错:"+e.getMessage());
}
%>
style.css