管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)"/>
基于javaweb+jsp的饮食营养健康管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax)
基于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等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
<script src="js/bootstrap.js"></script>
</head><body>
<nav class="navbar navbar-inverse navbar-fixed-top"><div class="container-fluid"><div class="navbar-header"><button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"><span class="sr-only">饮食营养健康管理系统</span> <span class="icon-bar"></span><span class="icon-bar"></span> <span class="icon-bar"></span></button><a class="navbar-brand" href="#">饮食营养健康管理系统</a></div><div id="navbar" class="navbar-collapse collapse"><ul class="nav navbar-nav navbar-right"><li><a href="#">欢迎:<span style="color: yellow">${loginUser.username}</span></a></li>
<if test ='noticeType != null'>`notice_type`,</if><if test ='createDate != null'>`create_date`</if></trim><trim prefix="values (" suffix=")" suffixOverrides=","><if test ='id != null'>#{id},</if><if test ='noticeName != null'>#{noticeName},</if><if test ='noticeText != null'>#{noticeText},</if><if test ='noticeType != null'>#{noticeType},</if><if test ='createDate != null'>#{createDate}</if></trim></insert><!--批量删除--><delete id="doRemoveBatch" parameterType="java.util.Collection">DELETE FROM `t_notice` WHERE `id` IN<foreach collection="list" item="id" separator="," open="(" close=")">
str = new String(str.getBytes("ISO-8859-1"), "GBK");}if (isMessyCode(str)) {str = new String(str.getBytes("GB2312"), "GBK");}} catch (Exception e) {e.printStackTrace();}System.out.println(parameterName + "==" + str.trim());return str.trim();}
}
package com.demo.util;import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;import javax.servlet.http.HttpServletRequest;
modal.find('#edit-userType_' + vo.userType).removeAttr("checked");}};}})})$('#modal-info').on('show.bs.modal', function (event) {let button = $(event.relatedTarget);let id = button.data('id');let modal = $(this);$.ajax({url: 'userGet?id=' + id,type: "get",success: function (voString) {let vo = eval('(' + voString + ')');modal.find('#info-username').text(vo.username);modal.find('#info-password').text(vo.password);
str = new String(str.getBytes("GBK"), "ISO-8859-1");}if (isMessyCode(str)) {str = new String(str.getBytes("UTF-8"), "GB2312");}if (isMessyCode(str)) {str = new String(str.getBytes("ISO-8859-1"), "GB2312");}if (isMessyCode(str)) {str = new String(str.getBytes("GBK"), "GB2312");}if (isMessyCode(str)) {str = new String(str.getBytes("UTF-8"), "GBK");}if (isMessyCode(str)) {str = new String(str.getBytes("ISO-8859-1"), "GBK");}if (isMessyCode(str)) {str = new String(str.getBytes("GB2312"), "GBK");}} catch (Exception e) {e.printStackTrace();}System.out.println(parameterName + "==" + str.trim());return str.trim();}
</td><th style="text-align: center;"><button class="btn btn-pill btn-line btn-danger btn-sm" data-id="${vo.id}"data-toggle="modal" data-target="#modal-info">详情</button><button class="btn btn-pill btn-line btn-danger btn-sm"<c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>data-id="${vo.id}"data-toggle="modal" data-target="#modal-edit">编辑</button><button class="btn btn-pill btn-line btn-default btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> data-id="${vo.id}"data-toggle="modal" data-target="#modal-delete">删除</button></th></tr></c:forEach></tbody>
<c:out value="${vo.foodText}"/></c:otherwise></c:choose></td><th style="text-align: center;"><button class="btn btn-pill btn-line btn-danger btn-sm" data-id="${vo.id}"data-toggle="modal" data-target="#modal-info">详情</button><button class="btn btn-pill btn-line btn-danger btn-sm"<c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if>data-id="${vo.id}"data-toggle="modal" data-target="#modal-edit">编辑</button><button class="btn btn-pill btn-line btn-default btn-sm" <c:if test="${loginUser.userType != '管理员'}">disabled="disabled" title="没有权限!!!"</c:if> data-id="${vo.id}"data-toggle="modal" data-target="#modal-delete">删除</button></th></tr></c:forEach></tbody></table></div><div style="float: right;padding-right: 10px;color: #515151;"><jsp:include page="split.jsp"/></div></div></div>
</div>
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));this.redirectList(request, response);}/*** 编辑用户** @param response
<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="foodDelete"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title">删除食材信息</h4></div><div class="modal-body">确认要删除该食材信息记录吗?<div class="form-group hidden"><label class="control-label">(hidden)</label><input type="hidden" class="form-control" name="action" value="delete">
String msg;User loginUser = (User) request.getSession().getAttribute("loginUser");String oldPassword = Util.decode(request, "oldPassword");if (!loginUser.getPassword().equals(oldPassword)) {msg = "原密码错误!";} else {String newPassword = Util.decode(request, "newPassword");loginUser.setPassword(newPassword);this.userService.update(loginUser);msg = "修改成功!";}request.getSession().setAttribute("alert_msg", msg);request.getRequestDispatcher("reset_password.jsp").forward(request, response);}// 返回一个随机颜色(Color对象)private Color getRandomColor(int minColor, int maxColor) {Random random = new Random();// 保存minColor最大不会超过255if (minColor > 255)minColor = 255;
* 删除食疗处方** @param response* @param request* @throws IOException*/@RequestMapping("shiliaoDelete")public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {Serializable id = Util.decode(request, "id");shiliaoService.delete(Arrays.asList(id));this.redirectList(request, response);}/*** 编辑食疗处方** @param response* @param request
运行环境
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…均可修改
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
登录、注册、退出、用户模块、公告模块、食材信息模块、食疗处方模块的增删改查管理
更多推荐
基于javaweb+jsp的饮食营养健康管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap Ajax
发布评论