基于javaweb+jsp的宠物领养信息管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改
开发工具:eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
<div class="form-group">
<label class="control-label">性别:</label>
<input name="linyangSex" id="edit-linyangSex_男" type="radio" value="男"/>男
<input name="linyangSex" id="edit-linyangSex_女" type="radio" value="女"/>女
<input name="linyangSex" id="edit-linyangSex_保密" type="radio" value="保密"/>保密
</div>
<div class="form-group">
<label for="edit-linyangAddress" class="control-label">地址:</label>
<input type="text" class="form-control" name="linyangAddress" id="edit-linyangAddress">
</div>
<div class="form-group">
<label for="edit-linyangPet" class="control-label">宠物编号:</label>
<input type="text" class="form-control" name="linyangPet" id="edit-linyangPet">
</div>
<div class="form-group">
<label for="edit-linyangTime" class="control-label">领养时间:</label>
<input type="text" class="form-control" name="linyangTime" id="edit-linyangTime">
</div>
<div class="form-group">
<label class="control-label">是否同意:</label>
<input name="linyangAgree" id="edit-linyangAgree_是" type="radio" value="是"/>是
<input name="linyangAgree" id="edit-linyangAgree_否" type="radio" value="否"/>否
</div>
<div class="form-group">
<label for="edit-linyangText" class="control-label">备注:</label>
<textarea style="height: 100px;" class="form-control" name="linyangText" id="edit-linyangText"></textarea>
</div>
} else {
modal.find('#edit-linyangAgree_' + vo.linyangAgree).removeAttr("checked");
}
};
modal.find('#edit-linyangText').val(vo.linyangText);
}
})
})
$('#modal-info').on('show.bs.modal', function (event) {
let button = $(event.relatedTarget);
let id = button.data('id');
let modal = $(this);
$.ajax({
url: 'linyangGet?id=' + id,
type: "get",
success: function (voString) {
let vo = eval('(' + voString + ')');
modal.find('#info-linyangName').text(vo.linyangName);
modal.find('#info-linyangTel').text(vo.linyangTel);
modal.find('#info-linyangSex').text(vo.linyangSex);
modal.find('#info-linyangAddress').text(vo.linyangAddress);
modal.find('#info-linyangPet').text(vo.linyangPet);
modal.find('#info-linyangTime').text(vo.linyangTime);
modal.find('#info-linyangAgree').text(vo.linyangAgree);
modal.find('#info-linyangText').text(vo.linyangText);
}
})
<if test ='userType != null'>`user_type` = #{userType}</if>
</set>
WHERE `id` = #{id}
</update>
<!--获取-->
<select id="findById" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_user` WHERE `id` = #{id}
</select>
<!--列表-->
<select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" /> FROM `t_user`
<where>
<if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
${searchColumn} LIKE CONCAT('%',#{keyword},'%') AND
</if>
1=1
</where>
ORDER BY id ASC
<if test="startIndex != null and pageSize != null">
LIMIT #{startIndex},#{pageSize};
</if>
//根据ID获取值
if (document.getElementById("edit-username").value.trim().length == 0) {
alert("用户名不能为空");
return false;
}
if (document.getElementById("edit-password").value.trim().length == 0) {
alert("密码不能为空");
return false;
}
if (document.getElementById("edit-realName").value.trim().length == 0) {
alert("姓名不能为空");
return false;
}
if (document.getElementById("edit-userPhone").value.trim().length == 0) {
alert("手机不能为空");
return false;
}
return true;
vo.setUsername(Util.decode(request, "username"));
vo.setPassword(Util.decode(request, "password"));
vo.setRealName(Util.decode(request, "realName"));
vo.setUserSex(Util.decode(request, "userSex"));
vo.setUserPhone(Util.decode(request, "userPhone"));
vo.setUserText(Util.decode(request, "userText"));
vo.setUserType(Util.decode(request, "userType"));
//调用Service层的增加(insert)方法
userService.insert(vo);
this.redirectList(request, response);
}
/**
* 删除用户
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("userDelete")
public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
Serializable id = Util.decode(request, "id");
userService.delete(Arrays.asList(id));
*
* @param response
* @param request
* @throws IOException
*/
@RequestMapping("linyangAdd")
public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
Linyang vo = new Linyang();
//取出页面传进来的参数
vo.setLinyangName(Util.decode(request, "linyangName"));
vo.setLinyangTel(Util.decode(request, "linyangTel"));
vo.setLinyangSex(Util.decode(request, "linyangSex"));
vo.setLinyangAddress(Util.decode(request, "linyangAddress"));
vo.setLinyangPet(Util.decode(request, "linyangPet"));
vo.setLinyangTime(Util.decode(request, "linyangTime"));
vo.setLinyangAgree(Util.decode(request, "linyangAgree"));
return true;
}
//@Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
}
//@Override
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
}
}
package com.demo.vo;
import java.io.Serializable;
/**
* 用户(t_user表对应的Java实体类)
*/
</div>
</form>
</div>
</div>
</div>
<!-- delete -->
<div class="modal fade" id="modal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<form action="petDelete">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
private String linyangAgree;//是否同意:是/否
private String linyangText;//备注
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getLinyangName() {
return linyangName;
}
public void setLinyangName(String linyangName) {
this.linyangName = linyangName;
}
</script>
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/jquery-3.5.1.js"></script>
<script src="js/bootstrap.js"></script>
<style>
body{padding: 0;margin: 0;background: url("img/1.jpg") no-repeat;background-size: 100%;}
</style>
<script type="text/javascript">
let alert_msg = '${alert_msg}';
if (alert_msg != null && alert_msg.trim() != '') {
window.alert(alert_msg);
}
</script>
运行环境
Java≥6、Tomcat≥7.0、MySQL≥5.5
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
技术框架
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap Ajax
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可修改
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、领养模块、宠物模块的增删改查管理