JSP程序设计——手机销售网后台设计

article/2025/9/28 7:05:37

信管1172 高颖 201711671206

 

一、实验要求

系统后台开发具体要求(课本第10章的项目基础上):
1.在导航条中添加一个后台管理菜单。
2.后台页面分成左右两个框,左边显示一个树形菜单,右边根据菜单选择显示相应的交互界面。
3.实现对用户,产品分类,产品,订单等的后台管理。
4.具体界面自行设计。

 二、功能说明

(1)用户

1.主页

 

2.登录

3.注册

 

4.登录

5.浏览手机

6.查询手机

7.查看购物车

 

(2)后台

1.主页

源码:

tree.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<div class="treebox col-sm-2 col-md-2 col-lg-2" >
    <ul class="menu">
        <li class="level1">
            <a href="#none"><em class="ico ico1"></em>用户管理<i class="down"></i></a>
            <ul class="level2">
                <li><a href="${pageContext.request.contextPath }/user?method=list">用户列表</a></li>
                <li><a href="javascript:;">用户增加</a></li>
            </ul>
        </li>
        <li class="level1">
            <a href="#none"><em class="ico ico2"></em>商品管理<i></i></a>
            <ul class="level2">
                <li><a href="${pageContext.request.contextPath }/good?method=list">商品列表</a></li>
                <li><a href="javascript:;">商品类型</a></li>
                <li><a href="javascript:;">商品库存</a></li>
            </ul>
        </li>
        <li class="level1">
            <a href="#none"><em class="ico ico3"></em>订单管理<i></i></a>
            <ul class="level2">
                <li><a href="${pageContext.request.contextPath }/order?method=list">订单一览</a></li>
                <li><a href="javascript:;">订单处理</a></li>
            </ul>
        </li>
    </ul>
</div>
 

welcome.jsp

<%--
  Created by IntelliJ IDEA.
  User: Lusty
  Date: 2019-05-19
  Time: 13:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Title</title>
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath }/assets/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/assets/css/style.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath }/assets/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath }/assets/js/easing.js"></script>
    <script src="${pageContext.request.contextPath }/assets/bootstrap/js/bootstrap.min.js"></script>
</head>
<style>
    @media (min-width: 1200px){
        .container {
            width: 20%;
        }
    }
    .container {
        margin-top: 10%;
    }
</style>
<body>
<div class="container">

    <form class="form-signin">
        <h2 class="form-signin-heading">请登录后台系统</h2>
        <label for="inputEmail" class="sr-only">用户名</label>
        <input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
        <label for="inputPassword" class="sr-only">密码</label>
        <input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
        <div class="checkbox">
            <label>
                <input type="checkbox" value="remember-me"> Remember me
            </label>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
    </form>

</div>
</body>
</html>

2.用户注册

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户列表</title>
    <style>
        *{ margin: 0; padding: 0; }
        img{border:0;}
        ul,li{list-style-type:none;}
        a {color:#00007F;text-decoration:none;}
        a:hover {color:#bd0a01;text-decoration:underline;}
        .treebox{ width: 200px; background-color:#1a6cb9;height:95vh; }
        .menu{ overflow: hidden; border-color: #ddd; border-style: solid ; border-width: 0 1px 1px ;
            float: left;}
        .menu li.level1>a{
            display:block;
            height: 45px;
            line-height: 45px;
            color: #fff;
            padding-left: 50px;
            border-bottom: 1px solid #000;
            font-size: 16px;
            position: relative;
        }
        .menu li.level1 a:hover{ text-decoration: none;background-color:#326ea5;   }
        .menu li.level1 a.current{ background: #0f4679; }
        .ico{ width: 20px; height: 20px; display:block;   position: absolute; left: 20px; top: 10px; background-repeat: no-repeat; background-image: url(${pageContext.request.contextPath }/image/ico1.png); }
        .level1 i{ width: 20px; height: 10px; background-image:url(${pageContext.request.contextPath }/image/arrow.png); background-repeat: no-repeat; display: block; position: absolute; right: 20px; top: 20px; }
        .level1 i.down{ background-position: 0 -10px; }

        .ico1{ background-position: 0 0; }
        .ico2{ background-position: 0 -20px; }
        .ico3{ background-position: 0 -40px; }
        .ico4{ background-position: 0 -60px; }
        .ico5{ background-position: 0 -80px; }
        .menu li ul{ overflow: hidden; }
        .menu li ul.level2{ display: none;background: #0f4679;  }
        .menu li ul.level2 li a{
            display: block;
            height: 45px;
            line-height: 45px;
            color: #fff;
            text-indent: 60px;
            /*border-bottom: 1px solid #ddd; */
            font-size: 14px;
        }

    </style>
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath }/assets/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/assets/css/style.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath }/assets/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath }/assets/js/easing.js"></script>
    <script src="${pageContext.request.contextPath }/assets/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<%--顶部条栏--%>
<div style="height: 5vh">
    <!--路径导航-->
    <ol class="breadcrumb breadcrumb_nav">
        <li>首页</li>
        <li>用户管理</li>
        <li class="active">用户列表</li>
    </ol>
</div>
<div class="row">
    <div class="treebox col-sm-2 col-md-2 col-lg-2" style="height: 100vh">
        <ul class="menu">
            <li class="level1">
                <a href="#none"><em class="ico ico1"></em>用户管理<i class="down"></i></a>
                <ul class="level2">
                    <li><a href="${pageContext.request.contextPath }/user?method=list">用户列表</a></li>
                    <li><a href="javascript:;">用户增加</a></li>
                </ul>
            </li>
            <li class="level1">
                <a href="#none"><em class="ico ico2"></em>商品管理<i></i></a>
                <ul class="level2">
                    <li><a href="${pageContext.request.contextPath }/good?method=list">商品列表</a></li>
                    <li><a href="javascript:;">商品类型</a></li>
                    <li><a href="${pageContext.request.contextPath }/user?method=editUI">商品增加</a></li>
                </ul>
            </li>
            <li class="level1">
                <a href="#none"><em class="ico ico3"></em>订单管理<i></i></a>
                <ul class="level2">
                    <li><a href="${pageContext.request.contextPath }/order?method=list">订单一览</a></li>
                    <li><a href="javascript:;">订单处理</a></li>
                </ul>
            </li>
        </ul>
    </div>
    <div class="page-content col-sm-10 col-md-10 col-lg-10">
        <div class="panel panel-default">
            <div class="panel-heading">用户列表</div>
            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th width="3%">
                            <input class="check_all" type="checkbox">
                        </th>
                        <th width="5%">登录名</th>
                        <th width="5%">手机号</th>
                        <th width="5%">地址</th>
                        <th width="5%">真名</th>
                        <%--<th width="5%">操作</th>--%>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${pageResult.list}" var="item">
                        <tr>
                            <td>
                                <input class="check_all" type="checkbox" name="ids[]" value="8">
                            </td>
                            <td>${item.loginName }</td>
                            <td>${item.phone}</td>
                            <td>${item.address}</td>
                                <%--<td>--%>
                                <%--<c:if test="${item.gender==1}">男</c:if>--%>
                                <%--<c:if test="${item.gender==2}">女</c:if>--%>
                                <%--<c:if test="${item.gender==3}">保密</c:if>--%>
                                <%--</td>--%>
                            <td>${item.realname}</td>
                                <%--<td>--%>
                                <%--<a href="${pageContext.request.contextPath }/user?method=editUI&id=${item.id}" class="btn btn-info btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</a>--%>
                                <%--<a href="${pageContext.request.contextPath }/user?method=delete&id=${item.id}" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-eye-open"></span>删除</a>--%>
                                <%--</td>--%>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>

                <div class="panel-footer clearfix">
                    <div class="pull-left">
                        <div class="form-group">
                            <label>总记录数:${pageResult.totalRecord}</label>
                            <label>每页显示:</label>
                            <select class="form-control" id="pageSize" οnchange="queryByPages()">
                                <option value="5"  <c:if test="${pageResult.pageSize eq 5}">selected="selected"</c:if> >5</option>
                                <option value="10" <c:if test="${pageResult.pageSize eq 10}">selected="selected"</c:if> >10</option>
                                <option value="15" <c:if test="${pageResult.pageSize eq 15}">selected="selected"</c:if> >15</option>
                            </select>
                        </div>
                    </div>
                    <nav class="pull-right">
                     


http://chatgpt.dhexx.cn/article/xVP92xqH.shtml

相关文章

vue3中ref的理解

1.什么是ref? ref和reactive一样,也是用来实现响应式数据的方法由于reactive必须传递一个对象,所以在实际开发中如果只是想让某个变量实现响应式的时候回非常麻烦所以Vue3提供了ref方法实现简单值得监听 2.ref本质 ref底层其实还是reactive,所以当运行时系统会自动根据传入…

Vue中的ref属性

一、引出ref 大家在使用原生JS对DOM进行操作时肯定第一步是需要获取DOM元素的&#xff0c;比如通过id获取document.getElementById(“idName")&#xff0c;或者使用jQuery获取 jQuery对象$("#idName”)&#xff0c;vue对此也实现了比较方便的获取操作DOM的用法 — re…

Vue与ref属性与refs

ref 被用来给DOM元素或子组件注册引用信息。引用信息会根据父组件的 $refs 对象进行注册。如果在普通的DOM元素上使用&#xff0c;引用信息就是元素; 如果用在子组件上&#xff0c;引用信息就是组件实例 注意&#xff1a;只要想要在Vue中直接操作DOM元素&#xff0c;就必须用r…

ref和out的区别

ref 关键字 是作用是把一个变量的引用传入函数&#xff0c;和 C/C 中的指针几乎一样&#xff0c;就是传入了这个变量的栈指针。 out 关键字 的作用是当你需要返回多个变量的时候&#xff0c;可以把一个变量加上 out 关键字&#xff0c;并在函数内对它赋值&#xff0c;以实现返…

vue ref介绍

基本用法 ref 有三种用法&#xff1a; 1、ref 加在普通的元素上&#xff0c;用this.ref.name 获取到的是dom元素 2、ref 加在子组件上&#xff0c;用this.ref.name 获取到的是组件实例&#xff0c;可以使用组件的所有方法。 3、如何利用 v-for 和 ref 获取一组数组或者dom …

vue3中ref的使用

一.定义一个数据的响应式 <template><h2>{{count}}</h2><hr><button click"update">更新</button> </template><script> import {ref } from vue export default {setup () {// 定义响应式数据 ref对象const count …

ref和reactive

一&#xff0c;前言 1.ref和reactive是vue3基于组合式api模式下&#xff0c;在setup中用于声明的具有响应式的数据的方法。 二&#xff0c;ref 1.ref通常用于声明基础类型响应式数据。 import { ref } from vue const age ref(10) //声明响应式数据2.ref返回的是被包装过的…

Vue中ref的用法

1、ref 加在普通的元素上&#xff0c;用this.$refs.&#xff08;ref值&#xff09; 获取到的是dom元素 <!DOCTYPE html> <html><head><meta charset"utf-8"><title></title></head><body><div id"app"…

c#引用(ref)的用法和应用实例

无论是浅拷贝与深拷贝&#xff0c;C#都将源对象中的所有字段复制到新的对象中。不过&#xff0c;对于值类型字段&#xff0c;引用类型字段以及字符串类型字段的处理&#xff0c;两种拷贝方式存在一定的区别&#xff08;见下表&#xff09;。 1. 一般对C#中传值调用和传引用调用…

什么时候用ref,怎么用ref

文章目录 用refref是一个字符串ref是一个内联函数ref是一个回调函数ref通过调用React.createRef()生成 不用ref 用ref “打在我身&#xff0c;疼在她心”时&#xff0c;用ref。比如&#xff0c;点击事件绑定在某个标签上&#xff0c;事件处理函数中却要访问另一个完全不相关的…

[Vue]ref属性

前言 系列文章目录&#xff1a; [Vue]目录 老师的课件笔记&#xff0c;不含视频 https://www.aliyundrive.com/s/B8sDe5u56BU 笔记在线版&#xff1a; https://note.youdao.com/s/5vP46EPC 视频&#xff1a;尚硅谷Vue2.0Vue3.0全套教程丨vuejs从入门到精通 文章目录 前言1. ref…

什么是 ref 引用

1. 什么是 ref 引用 ref 用来辅助开发者在 不依赖于 jQuery 的情况下 &#xff0c;获取 DOM 元素或组件的引用。 每个 vue 的组件实例上&#xff0c;都包含一个 $refs 对象 &#xff0c;里面存储着对应的 DOM 元素或组件的引用。默认情况下&#xff0c; 组件的 $refs 指向一…

关于 Ref 你需要知道的知识点

Intro 在 React 项目中&#xff0c;有很多场景需要用到 Ref。例如使用 ref 属性获取 DOM 节点&#xff0c;获取 ClassComponent 对象实例&#xff1b;用 useRef Hook 创建一个 Ref 对象&#xff0c;以便解决像 setInterval 获取不到最新的 state 的问题&#xff1b;你也可以调用…

学习Vue3 第六章(认识Ref全家桶)

视频教程小满Vue3&#xff08;第六章 Ref 全家桶 & 源码解析&#xff09;_哔哩哔哩_bilibili ref 接受一个内部值并返回一个响应式且可变的 ref 对象。ref 对象仅有一个 .value property&#xff0c;指向该内部值。 案例 我们这样操作是无法改变message 的值 应为mess…

Vue中ref和$refs的介绍及使用

在JavaScript中需要通过document.querySelector("#demo")来获取dom节点&#xff0c;然后再获取这个节点的值。在Vue中&#xff0c;我们不用获取dom节点&#xff0c;元素绑定ref之后&#xff0c;直接通过this.$refs即可调用&#xff0c;这样可以减少获取dom节点的消耗…

C++实现身份证号码过滤与排序

1.描述 警察办案里检索到一批(n个)身份证号码&#xff0c;希望按出生日期对它们进行从大到小排序&#xff0c;如果有相同日期&#xff0c;则按身份证号码大小进行排序&#xff0c;如果是错误的身份证号&#xff0c;则从排序列表中删除(仅需判断前两位省级地区编码是否在下面的…

基于MATLAB的身份证号码识别系统

一、课题目标 本文主要介绍了一种采用基于matlab数字图像处理的图像识别技术&#xff0c;对身份证原始图像中的序列号标示进行图像识别的方法。该系统通过图像预处理、图像定位、图像校正并最终输出结果。在系统调试阶段&#xff0c;根据遇到的错误即时对原系统进行调整&#x…

python爬虫--根据身份证号码获取户籍地、出生年月等信息

一、背景 工作中偶尔会遇到这样的情况&#xff0c;给你一堆客户身份证号码&#xff0c;然后要你把对应的性别、生日、户籍地等信息弄出来。 最常用的方法就是用excel表套公式&#xff0c;这个方式如果用来取性别、生日这些信息的话问题不大&#xff0c;毕竟这些规则还好梳理&…

BP算法的身份证号码识别

摘 要:基于反向传播算法的多层前馈网络(简称BP神经网络)在图像处理方面应用较为广泛。目前&#xff0c;身份证号码识别技术 在图像识别领域迅猛发展&#xff0c;为提高识别身份证号码的速度及准确性&#xff0c;本文研究一种基于BP神经网络的身份证号码识别系统。首 先&#xf…

Matlab实现身份证号码快速识别

用Matlab 实现身份证号码快速识别 摘 要&#xff1a; 探讨身份证号码的快速识别。 首先从身份证图像中获取 0&#xff5e;9 共 10 个号码数字的样本图像&#xff0c; 从中提取其空间分布特征和结构特征&#xff1b; 再从待识别的身份证图像中提取各号码数字的空间分布特征和结构…