JavaWeb(34) : 客户关系管理系统

零、数据库表与配置文件

0.1  数据库t_customer表

CREATE TABLE `t_customer` (
  `cid` char(32) NOT NULL,
  `cname` varchar(40) NOT NULL,
  `gender` varchar(6) NOT NULL,
  `birthday` date DEFAULT NULL,
  `cellphone` varchar(15) NOT NULL,
  `email` varchar(40) DEFAULT NULL,
  `description` varchar(500) DEFAULT NULL,
  PRIMARY KEY (`cid`)
);

0.2  c3p0-config.xml

<?xml version="1.0" encoding="UTF-8"?>
 <c3p0-config>
 	<!-- c3p0默认配置
 	如果在代码中“ComboPooledDataSource ds = new ComboPooledDataSource();”
 	这样写就表示使用的是C3P0的缺省(默认)配置信息来创建数据源 -->
	<default-config>
		<!-- 连接四大参数配置 -->
         <property name="jdbcUrl">jdbc:mysql://localhost:3306/customers</property>
         <property name="driverClass">com.mysql.jdbc.Driver</property>
         <property name="user">root</property>
        <property name="password">root</property>
       <!--  池参数配置 -->
        <property name="acquireIncrement">5</property>
        <property name="initialPoolSize">10</property>
       <property name="minPoolSize">5</property>
        <property name="maxPoolSize">20</property>
    </default-config>
    
   <!--  c3p0命名配置
    如果在代码中“ComboPooledDataSource ds = new ComboPooledDataSource("MySQL");”
    这样写就表示使用的是name是MySQL的配置信息来创建数据源 -->
    <named-config name="MySQL">
    	<!-- 连接四大参数配置 -->
         <property name="jdbcUrl">jdbc:mysql://localhost:3306/customers</property>
         <property name="driverClass">com.mysql.jdbc.Driver</property>
         <property name="user">root</property>
        <property name="password">root</property>
       <!--  池参数配置 -->
        <property name="acquireIncrement">5</property>
        <property name="initialPoolSize">10</property>
       <property name="minPoolSize">5</property>
        <property name="maxPoolSize">20</property>
    </named-config>
</c3p0-config>

0.3  db.properties

driver = com.mysql.jdbc.Driver
url = jdbc:mysql://localhost:3306/customers?rewriteBatchedStatements=true
username = root
password =root

0.4  JdbcUtils.java

package waf.yty.cstm.utils;

批处理插入数据的时候会用到!

package waf.yty.cstm.utils;

import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

public class JdbcUtils {

	private static String driver = null;
	private static String url = null;
	private static String username = null;
	private static String password = null;
	
	static {
		try {
			// 读取db.properties文件中的数据库连接信息
			InputStream in = JdbcUtils.class.getClassLoader().getResourceAsStream("db.properties");
			Properties prop = new Properties();
			prop.load(in);
			// 获取数据库参数
			driver = prop.getProperty("driver");
			url = prop.getProperty("url");
			username = prop.getProperty("username");
			password = prop.getProperty("password");
			// 加载数据库驱动
			Class.forName(driver);
			
		} catch (Exception e) {
			throw new ExceptionInInitializerError(e);
		}
	}
	/**
	 * 获取数据库连接对象
	 * @return
	 * @throws SQLException
	 */
	public static Connection getConnection() throws SQLException {
		return DriverManager.getConnection(url, username, password);
		
	}
	
	public static void release(Connection conn, Statement stmt, ResultSet rs) throws SQLException {
		if (rs != null) {
			rs.close();
		}
		if (stmt != null) {
			stmt.close();
		}
		if (conn != null) {
			conn.close();
		}
	}

}

0.5  CustomerTest.java

package waf.yty.cstm.dao;

批处理操作!

package waf.yty.cstm.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;


import org.junit.Test;

import cn.itcast.commons.CommonUtils;
import waf.yty.cstm.utils.JdbcUtils;

public class CustomerTest {

	@Test
	public void fun1() throws SQLException {
//		CustomerDao dao = new CustomerDao();
//		for
		ResultSet rs = null;
		Connection con = JdbcUtils.getConnection();
		String sql = "insert into t_customer values (?,?,?,?,?,?,?)";
		PreparedStatement pstmt = con.prepareStatement(sql);
		for (int i = 0; i < 300; i++) {
			pstmt.setString(1, CommonUtils.uuid());
			pstmt.setString(2, "cstm_" + i);
			pstmt.setString(3, i%2==0?"男":"女");
			pstmt.setDate(4, new java.sql.Date(1992-11-12));
			pstmt.setString(5, "666" + i);
			pstmt.setString(6, "cstm_" + i + "@126.com");
			pstmt.setString(7, "WDNMD");
			
			pstmt.addBatch();

		}
		
		long start = System.currentTimeMillis();
		pstmt.executeBatch();
		long end = System.currentTimeMillis();
		JdbcUtils.release(con, pstmt, rs);
		System.out.println(end - start);
	}
}

0.6  BaseServlet

package cn.itcast.servlet;

import java.io.IOException;
import java.lang.reflect.Method;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * BaseServlet用来作为其它Servlet的父类
 * 
 * @author qdmmy6
 * 
 *         一个类多个请求处理方法,每个请求处理方法的原型与service相同! 原型 = 返回值类型 + 方法名称 + 参数列表
 */
@SuppressWarnings("serial")
public class BaseServlet extends HttpServlet {
	@Override
	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html;charset=UTF-8");//处理响应编码
		request.setCharacterEncoding("UTF-8");
		
		/**
		 * 1. 获取method参数,它是用户想调用的方法 2. 把方法名称变成Method类的实例对象 3. 通过invoke()来调用这个方法
		 */
		String methodName = request.getParameter("method");
		Method method = null;
		/**
		 * 2. 通过方法名称获取Method对象
		 */
		try {
			method = this.getClass().getMethod(methodName,
					HttpServletRequest.class, HttpServletResponse.class);
		} catch (Exception e) {
			throw new RuntimeException("您要调用的方法:" + methodName + "它不存在!", e);
		}
		
		/**
		 * 3. 通过method对象来调用它
		 */
		try {
			String result = (String)method.invoke(this, request, response);
			if(result != null && !result.trim().isEmpty()) {//如果请求处理方法返回不为空
				int index = result.indexOf(":");//获取第一个冒号的位置
				if(index == -1) {//如果没有冒号,使用转发
					request.getRequestDispatcher(result).forward(request, response);
				} else {//如果存在冒号
					String start = result.substring(0, index);//分割出前缀
					String path = result.substring(index + 1);//分割出路径
					if(start.equals("f")) {//前缀为f表示转发
						request.getRequestDispatcher(path).forward(request, response);
					} else if(start.equals("r")) {//前缀为r表示重定向
						response.sendRedirect(request.getContextPath() + path);
					}
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}

0.7  TxQueryRunner.class

package cn.itcast.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;

public class TxQueryRunner extends QueryRunner {

	@Override
	public int[] batch(String sql, Object[][] params) throws SQLException {
		Connection con = JdbcUtils.getConnection();
		int[] result = super.batch(con, sql, params);
		JdbcUtils.releaseConnection(con);
		return result;
	}

	@Override
	public <T> T query(String sql, ResultSetHandler<T> rsh, Object... params)
			throws SQLException {
		Connection con = JdbcUtils.getConnection();
		T result = super.query(con, sql, rsh, params);
		JdbcUtils.releaseConnection(con);
		return result;
	}
	
	@Override
	public <T> T query(String sql, ResultSetHandler<T> rsh) throws SQLException {
		Connection con = JdbcUtils.getConnection();
		T result = super.query(con, sql, rsh);
		JdbcUtils.releaseConnection(con);
		return result;
	}

	@Override
	public int update(String sql) throws SQLException {
		Connection con = JdbcUtils.getConnection();
		int result = super.update(con, sql);
		JdbcUtils.releaseConnection(con);
		return result;
	}

	@Override
	public int update(String sql, Object param) throws SQLException {
		Connection con = JdbcUtils.getConnection();
		int result = super.update(con, sql, param);
		JdbcUtils.releaseConnection(con);
		return result;
	}

	@Override
	public int update(String sql, Object... params) throws SQLException {
		Connection con = JdbcUtils.getConnection();
		int result = super.update(con, sql, params);
		JdbcUtils.releaseConnection(con);
		return result;
	}
}

0.8  JdbcUtils.class

0.7  TxQueryRunner.class 用到此JdbcUtils类!

package cn.itcast.jdbc;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

/**
 * 使用本类的方法,必须提供c3p0-copnfig.xml文件
 * @author qdmmy6
 */
public class JdbcUtils {
	// 饿汉式
	private static DataSource ds = new ComboPooledDataSource();
	
	/**
	 * 它为null表示没有事务
	 * 它不为null表示有事务
	 * 当开启事务时,需要给它赋值
	 * 当结束事务时,需要给它赋值为null
	 * 并且在开启事务时,让dao的多个方法共享这个Connection
	 */
	private static ThreadLocal<Connection> tl = new ThreadLocal<Connection>();
	
	public static DataSource getDataSource() {
		return ds;
	}
	
	/**
	 * dao使用本方法来获取连接
	 * @return
	 * @throws SQLException
	 */
	public static Connection getConnection() throws SQLException {
		/*
		 * 如果有事务,返回当前事务的con
		 * 如果没有事务,通过连接池返回新的con
		 */
		Connection con = tl.get();//获取当前线程的事务连接
		if(con != null) return con;
		return ds.getConnection();
	}
	
	/**
	 * 开启事务
	 * @throws SQLException 
	 */
	public static void beginTransaction() throws SQLException {
		Connection con = tl.get();//获取当前线程的事务连接
		if(con != null) throw new SQLException("已经开启了事务,不能重复开启!");
		con = ds.getConnection();//给con赋值,表示开启了事务
		con.setAutoCommit(false);//设置为手动提交
		tl.set(con);//把当前事务连接放到tl中
	}
	
	/**
	 * 提交事务
	 * @throws SQLException 
	 */
	public static void commitTransaction() throws SQLException {
		Connection con = tl.get();//获取当前线程的事务连接
		if(con == null) throw new SQLException("没有事务不能提交!");
		con.commit();//提交事务
		con.close();//关闭连接
		con = null;//表示事务结束!
		tl.remove();
	}
	
	/**
	 * 回滚事务
	 * @throws SQLException 
	 */
	public static void rollbackTransaction() throws SQLException {
		Connection con = tl.get();//获取当前线程的事务连接
		if(con == null) throw new SQLException("没有事务不能回滚!");
		con.rollback();
		con.close();
		con = null;
		tl.remove();
	}
	
	/**
	 * 释放Connection
	 * @param con
	 * @throws SQLException 
	 */
	public static void releaseConnection(Connection connection) throws SQLException {
		Connection con = tl.get();//获取当前线程的事务连接
		if(connection != con) {//如果参数连接,与当前事务连接不同,说明这个连接不是当前事务,可以关闭!
			if(connection != null &&!connection.isClosed()) {//如果参数连接没有关闭,关闭之!
				connection.close();
			}
		}
	}
}

一、Customer.java

package waf.yty.cstm.domain;

其中的成员变量名一定要与数据库表中的列名一致!

package waf.yty.cstm.domain;
/**
 * 领域对象
 * 与表单和数据库表对应
 * @author yangtengyu
 *
 */
public class Customer {
	
	private String cid;
	private String cname;
	private String gender;
	private String birthday;
	private String cellphone;
	private String email;
	private String description;
	
	public String getCid() {
		return cid;
	}
	public void setCid(String cid) {
		this.cid = cid;
	}
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	public String getGender() {
		return gender;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	public String getCellphone() {
		return cellphone;
	}
	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	@Override
	public String toString() {
		return "Customer [cid=" + cid + ", cname=" + cname + ", gender=" + gender + ", birthday=" + birthday
				+ ", cellphone=" + cellphone + ", email=" + email + ", description=" + description + "]";
	}

	

}

二、CustomerDao.java

package waf.yty.cstm.dao;

与数据库交互,增删改查的具体实现!

package waf.yty.cstm.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.swing.text.DefaultEditorKit.CutAction;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import cn.itcast.jdbc.TxQueryRunner;
import waf.yty.cstm.domain.Customer;

public class CustomerDao {

	private QueryRunner qr = new TxQueryRunner();
	
	/**
	 * 添加客户
	 * @param c
	 */
	public void add(Customer c) {
		try {
			String sql = "insert into t_customer values (?,?,?,?,?,?,?)";
			Object[] params = {c.getCid(),c.getCname(),c.getGender(),
					c.getBirthday(),c.getCellphone(),c.getEmail(),c.getDescription()};
			qr.update(sql,params);
		} catch (SQLException e) {
			
			throw new RuntimeException(e);

		}
	}
	
	/**
	 * 查询所有
	 * @return
	 */
	public List<Customer> findAll() {
		try {
			String sql = "select * from t_customer";
			return qr.query(sql, new BeanListHandler<Customer>(Customer.class));
		} catch (SQLException e) {
			throw new RuntimeException(e);

		}
	}

	/**
	 * 加载要修改的客户
	 * @param cid
	 * @return
	 */
	public Customer load(String cid) {
		try {
			String sql = "select * from t_customer where cid=?";
			return qr.query(sql, new BeanHandler<Customer>(Customer.class), cid);
		} catch (SQLException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
		
	}

	/**
	 * 修改单体客户	
	 * @param c
	 */
	public void edit(Customer c) {
		try {
			String sql = "update t_customer set cname=?, gender=?, birthday=?," + 
					"cellphone=?, email=?, description=? where cid=?;";
			Object[] params = {c.getCname(),c.getGender(),c.getBirthday(),
					c.getCellphone(),c.getEmail(),c.getDescription(),c.getCid()};
			int result = qr.update(sql, params);
			System.out.println(result);
		} catch (SQLException e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}

	/**
	 * 删除某位客户
	 * @param cid
	 */
	public void delete(String cid) {
		try {
			String sql = "delete from t_customer where cid=?";
			qr.update(sql,cid);
//			if (deleteResult != 0) {
//				
//			}
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}
	}

	/**
	 * 多条件组合查询
	 * @param condition
	 * @return
	 */
	public List<Customer> query(Customer condition) {
		try {
		// 1.1 给出sql前半句
		StringBuilder sql = new StringBuilder("select * from t_customer where 1=1 ");
		
		List<Object> params = new ArrayList<Object>();
		
		// 1.2 判断条件,向sql中追加where子句
		String cname = condition.getCname();
		if (cname != null && !cname.trim().isEmpty()) {
			sql.append(" and cname like ?");
			params.add("%" + cname + "%");
		}
		
		String gender = condition.getGender();
		if (gender != null && !gender.trim().isEmpty()) {
			sql.append(" and gender=?");
			params.add(gender);
		}
		
		String cellphone = condition.getCellphone();
		if (cellphone != null && !cellphone.trim().isEmpty()) {
			sql.append(" and cellphone like ?");
			params.add("%" + cellphone + "%");
		}
		
		String email = condition.getEmail();
		if (email != null && !email.trim().isEmpty()) {
			sql.append(" and email like ?");
			params.add("%" + email + "%");
		}
		// 2.给出参数
		
		// 3.调用query方法,结果集处理器:BeanListHandler
		return qr.query(sql.toString(), new BeanListHandler<Customer>(Customer.class),params.toArray());
		
	} catch (SQLException e) {
		e.printStackTrace();
		throw new RuntimeException(e);
		}
	}
}

三、CustomerService.java

package waf.yty.cstm.service;

Servlet调用service , service再调用dao!

package waf.yty.cstm.service;

import java.util.List;

import waf.yty.cstm.dao.CustomerDao;
import waf.yty.cstm.domain.Customer;

/**
 * 业务层
 * 依赖dao
 * @author yangtengyu
 *
 */
public class CustomerService {
	
	private CustomerDao customerDao = new CustomerDao();
	
	/**
	 * 添加客户
	 * @param c
	 */
	public void add(Customer c) {
		customerDao.add(c);
	}
	
	/**
	 * 查询所有
	 * @return
	 */
	public List<Customer> findAll() {
		return customerDao.findAll();
	}

	/**
	 * 加载单个客户
	 * @param cid
	 * @return
	 */
	public Customer load(String cid) {
		// TODO Auto-generated method stub
		return customerDao.load(cid);
	}

	/**
	 * 修改单体客户
	 * @param c
	 */
	public void edit(Customer c) {
		// TODO Auto-generated method stub
		 customerDao.edit(c);
	}

	public void delete(String cid) {
		customerDao.delete(cid);
		
	}

	/**
	 * 多条件组合查询
	 * @param condition
	 * @return
	 */
	public List<Customer> query(Customer condition) {
		return customerDao.query(condition);
	}
}

四、CustomerServlet.java

package waf.yty.cstm.web.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.itcast.commons.CommonUtils;
import cn.itcast.servlet.BaseServlet;
import waf.yty.cstm.domain.Customer;
import waf.yty.cstm.service.CustomerService;
/**
 * Web层
 * @author yangtengyu
 *
 */
public class CustomerServlet extends BaseServlet {
	
	private CustomerService customerService = new CustomerService();
	
	
	public String add(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// 1.封装表单数据到Customer对象
		Customer c = CommonUtils.toBean(request.getParameterMap(), Customer.class);
		
		
		// 2.cid,uuid
		c.setCid(CommonUtils.uuid());
		// 3.添加工作
		customerService.add(c);
		// 4.request域保存成功信息
		request.setAttribute("msg", "恭喜,添加客户成功!");

		// 5.转发到msg.jsp
		return "f:/msg.jsp";

	}
	
	/**
	 * 查询所有
	 * @param request
	 * @param response
	 * @return
	 * @throws ServletException
	 * @throws IOException
	 */
	public String findAll(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// 1.调用service得到所有客户
		// 2.保存到request域
		request.setAttribute("cstmList", customerService.findAll());
		
		// 3.转发到list.jsp
		
		return "f:/list.jsp";
		
	}
	
	/**
	 * 编辑之前的加载工作
	 * @param request
	 * @param response
	 * @return
	 * @throws ServletException
	 * @throws IOException
	 */
	public String preEdit(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// 1.获取cid
		String cid = request.getParameter("cid");
		// 2.使用cid调用service方法,得到customer对象
		Customer cstm = customerService.load(cid);
		// 3.把customer保存到request域中
		request.setAttribute("cstm", cstm);
		// 4.转发edit.jsp显示表单
		
		return "f:/edit.jsp";
	}
	
	public String edit(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// 1.封装表单数据到Customer对象中
		Customer c = CommonUtils.toBean(request.getParameterMap(), Customer.class);
		// 2.调用service方法完成修改
		customerService.edit(c);
		// 3.保存成功信息request域
		request.setAttribute("msg", "修改客户成功!");
		// 4.转发到msg.jsp
		return "f:/msg.jsp";
	}
	
	
	public String delete(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		// 1.获取要删除的cid
		String cid = request.getParameter("cid");
		// 2.调用service的delete方法
		customerService.delete(cid);
		// 3.保存删除成功次信息
		request.setAttribute("msg", "删除客户成功!");
		// 4.请求转发
		return "f:/msg.jsp";
	}
	
	public String query(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		Customer condition = CommonUtils.toBean(request.getParameterMap(), Customer.class);
		List<Customer> cstmList = customerService.query(condition);
		request.setAttribute("cstmList", cstmList);
		return "/list.jsp";
	}

	

}

五、JSP页面

5.1  top.jsp

综合页面

  <body style="text-align: center;">
  	<h1>客户关系管理系统</h1>
    <a href="<c:url value='/add.jsp'/>">添加客户</a>  | 
    <a href="<c:url value='/CustomerServlet?method=findAll'/>">查询客户</a> | 
    <a href="<c:url value='/query.jsp'/>">高级搜索</a>  
  </body>

5.2  add.jsp

添加页面

<form action="<c:url value='/CustomerServlet'/>" method="post">
	<!-- 向servlet传递一个名为method的参数,其值表示要调用servlet的哪一个方法 -->
	<input type="hidden" name="method" value="add">

<input type="text" name="cname"/> 等等

5.3  list.jsp

显示所有客户信息

用核心标签库的foreach遍历request域对象的名为cstmList的集合

 <body>
<h3 align="center">客户列表</h3>
<table border="1" width="70%" align="center">
	<tr>
		<th>客户姓名</th>
		<th>性别</th>
		<th>生日</th>
		<th>手机</th>
		<th>邮箱</th>
		<th>描述</th>
		<th>操作</th>
	</tr>
	
<c:forEach items="${cstmList}" var="cstm">
	<tr>
		<%-- <td>${cstm.cid} </td> --%>
		<td>${cstm.cname} </td>
		<td>${cstm.gender}</td>
		<td>${cstm.birthday}</td>
		<td>${cstm.cellphone}</td>
		<td>${cstm.email}</td>
		<td>${cstm.description}</td>
		<!-- <td>萨弗隆尖塔</td> -->
		<td>
			<a href="<c:url value='/CustomerServlet?method=preEdit&cid=${cstm.cid }'/>">编辑</a>
			<a href="<c:url value='/CustomerServlet?method=delete&cid=${cstm.cid }'/>">删除</a>
		</td>
	</tr>
</c:forEach>		
	
</table>
  </body>

5.4  edit.jsp

<body>
<h3 align="center">编辑客户</h3>
<form action="<c:url value='/CustomerServlet'/>" method="post">
	<input type="hidden" name="method" value="edit"/>
	<input type="hidden" name="cid" value="${cstm.cid }"/>
<table border="0" align="center" width="40%" style="margin-left: 100px;">
	<tr>
		<td width="100px">客户名称</td>
		<td width="40%">
			<input type="text" name="cname" value="${cstm.cname}"/>
		</td>
		<td align="left">
			<label id="cnameError" class="error">&nbsp;</label>
		</td>
</tr>
<tr>
		<td>客户性别</td>
		<td>
			<input type="radio" name="gender" value="男" id="male" <c:if test="${cstm.gender == '男' }">checked='checked'</c:if> />
			<label for="male">男</label>
			<input type="radio" name="gender" value="女" id="female" <c:if test="${cstm.gender == '女' }">checked='checked'</c:if>/>
			<label for="female">女</label>
		</td>
		<td>
			<label id="genderError" class="error">&nbsp;</label>
		</td>
</tr>


5.5  query.jsp

 

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值