基于javaweb+jsp的超市管理系统
Posted javayms
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了基于javaweb+jsp的超市管理系统相关的知识,希望对你有一定的参考价值。
基于javaweb+jsp的超市管理系统
JavaWeb JavaBean JSP MVC mysql Tomcat javascript
基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架…均可
开发工具:idea或eclipse或myeclipse
部分代码实现JSP
</html>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>商品 详情</title>
<%@ include file="include/head.jsp" %>
</head>
<body>
<div class="container-fluid">
<ul class="nav nav-tabs">
<li><a href="GoodServlet?action=list">用户列表</a></li>
<li class="active"><a href="#">详情</a></li>
</ul>
<br/>
<form class="form-horizontal" role="form" action="#" method="post">
<input type="hidden" class="form-control" id="id" name="id" value="$vo.id"/>
<div class="form-group">
<label class="col-sm-3 control-label">商品:</label>
<div class="col-sm-5" style="padding-top: 7px;">
<div class="form-group">
<label class="col-sm-3 control-label">商品描述:</label>
<div class="col-sm-5">
<textarea rows="3" class="form-control" id="goodText" name="goodText" placeholder="请输入内容......"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库时间:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="goodTime" name="goodTime">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-5">
<input type="submit" class="btn btn-rect btn-grad btn-success btn-sm" value="保存">
<input type="button" class="btn btn-rect btn-grad btn-warning btn-sm" value="返回" onclick="javascript:history.back(-1);">
</div>
</div>
</form>
</div>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>商品 添加</title>
<%@ include file="include/head.jsp" %>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach items="$list" var="vo">
<tr>
<td><a href="GoodServlet?action=get&id=$vo.id">$vo.goodName</a></td>
<td>$vo.goodCount</td>
<td>$vo.goodPrice</td>
<td>$vo.goodType</td>
<td>$vo.goodSuppiler</td>
<td>$vo.goodTime</td>
<td>
<div class="form-group">
<label class="col-sm-3 control-label">商品描述:</label>
<div class="col-sm-5">
<textarea rows="3" class="form-control" id="goodText" name="goodText" placeholder="请输入内容......">$vo.goodText</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库时间:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="goodTime" name="goodTime" value="$vo.goodTime">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-5">
<input type="submit" class="btn btn-rect btn-grad btn-success btn-sm" value="保存">
<input type="button" class="btn btn-rect btn-grad btn-warning btn-sm" value="返回" onclick="javascript:history.back(-1);">
</div>
</form>
</div>
</body>
<script type="text/javascript">
//提交之前进行检查,如果return false,则不允许提交
function check()
//根据ID获取值
if (document.getElementById("goodName").value.trim().length == 0)
alert("商品不能为空!");
return false;
if (document.getElementById("goodCount").value.trim().length == 0)
alert("数量不能为空!");
<script type="text/javascript">
//提交之前进行检查,如果return false,则不允许提交
function check()
//根据ID获取值
if (document.getElementById("goodName").value.trim().length == 0)
alert("商品不能为空!");
return false;
if (document.getElementById("goodCount").value.trim().length == 0)
alert("数量不能为空!");
return false;
if (document.getElementById("goodPrice").value.trim().length == 0)
alert("价格不能为空!");
return false;
if (document.getElementById("goodType").value.trim().length == 0)
alert("类型不能为空!");
return false;
<body>
<div class="container-fluid">
<ul class="nav nav-tabs">
<li><a href="GoodServlet?action=list">商品 列表</a></li>
<li class="active"><a href="#">添加</a></li>
</ul>
<br/>
<form class="form-horizontal" role="form" action="GoodServlet?action=add" method="post" onsubmit="return check()">
<div class="form-group">
<label class="col-sm-3 control-label">商品:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="goodName" name="goodName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量:</label>
</head>
<body>
<div class="container-fluid">
<ul class="nav nav-tabs">
<li><a href="GoodServlet?action=list">商品 列表</a></li>
<li class="active"><a href="#">编辑</a></li>
</ul>
<br/>
<form class="form-horizontal" role="form" action="GoodServlet?action=edit" method="post" onsubmit="return check()">
<input type="hidden" class="form-control" id="id" name="id" value="$vo.id"/>
<div class="form-group">
<label class="col-sm-3 control-label">商品:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="goodName" name="goodName" value="$vo.goodName">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数量:</label>
<div class="col-sm-5">
<input type="text" class="form-control" id="goodCount" name="goodCount" value="$vo.goodCount">
<br/>
<form class="form-inline" id="searchForm" action="GoodServlet?action=list" method="post">
<div class="form-group">
<input type="text" class="form-control" name="keyword" id="keyword" placeholder="商品">
<input type="hidden" id="searchColumn" name="searchColumn" value="good_name"/>
</div>
<button class="btn btn-rect btn-grad btn-warning btn-sm"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>查询
</button>
</form>
<br/>
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>商品以上是关于基于javaweb+jsp的超市管理系统的主要内容,如果未能解决你的问题,请参考以下文章