0
点赞
收藏
分享

微信扫一扫

基于javaweb+jsp的旅游管理系统(JavaWeb MySQL JSP Bootstrap Servlet SSM SpringBoot)

最后的执着 2022-04-17 阅读 58
javamysql

基于javaweb+jsp的旅游管理系统(JavaWeb MySQL JSP Bootstrap Servlet SSM SpringBoot)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(int startIndex) {
        this.startIndex = startIndex;
    }

    public int getStart() {
    public void edit(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Notice vo = new Notice();
        vo.setId(Long.valueOf(Util.decode(request, "id")));
        vo.setNoticeName(Util.decode(request, "noticeName"));
        vo.setNoticeText(Util.decode(request, "noticeText"));
        vo.setNoticeType(Util.decode(request, "noticeType"));
        vo.setCreateDate(Util.decode(request, "createDate"));
        noticeService.update(vo);
        this.redirectList(request, response);
    }

    /**
     * 获取公告的详细信息(详情页面与编辑页面要显示该公告的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">添加用户</a>
        <br>
        <br>
    </div>
    <br>
    <form action="userAdd" method="post" onsubmit="return check()">
        <table class="index-content-table-add">
            <tr>
                <td width="12%">用户名:</td><td><input class="index-content-table-td-add" type="text" id="username" name="username" value=""/></td>
            </tr>
            <tr>
                <td width="12%">密码:</td><td><input class="index-content-table-td-add" type="text" id="password" name="password" value=""/></td>
            </tr>
            <tr>
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            </if>
            1=1
        </where>
    </select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.demo.dao.XianluMapper">

    <resultMap id="BaseResultMap" type="com.demo.vo.Xianlu" >
            <result column="id" property="id" />
            <result column="xianlu_name" property="xianluName" />
            <result column="xianlu_date" property="xianluDate" />
            <result column="xianlu_start" property="xianluStart" />
            <result column="xianlu_end" property="xianluEnd" />
            <result column="xianlu_text" property="xianluText" />
            </tr>
            <tr>
                <td width="12%">等级:</td><td><input class="index-content-table-td-add" type="text" id="jingdianLevel" name="jingdianLevel" value="${vo.jingdianLevel}"/></td>
            </tr>
            <tr>
                <td width="12%">人气:</td><td><input class="index-content-table-td-add" type="text" id="jingdianHot" name="jingdianHot" value="${vo.jingdianHot}"/></td>
            </tr>
            <tr>
                <td width="12%">类型:</td><td><input class="index-content-table-td-add" type="text" id="jingdianType" name="jingdianType" value="${vo.jingdianType}"/></td>
            </tr>
            <tr>
                <td width="12%">门票单价:</td><td><input class="index-content-table-td-add" type="text" id="jingdianPrice" name="jingdianPrice" value="${vo.jingdianPrice}"/></td>
            </tr>
            <tr>
        for (User user : list) {
            if (user.getUsername().equals(username) /*&& user.getPassword().equals(password)*/) {//说明该用户名已存在,必须换个用户名才能注册
                request.getSession().setAttribute("alert_msg", "错误:用户名已存在!");
                request.getRequestDispatcher("register.jsp").forward(request, response);
                return;
            }
        }
        User vo = new User();
        vo.setUsername(username);
        vo.setPassword(password);
        //vo.setUserType("普通用户");//需要设置一个默认值
        userService.insert(vo);
        request.getSession().setAttribute("alert_msg", "注册成功!用户名:[" + username + "]");
        request.getRequestDispatcher("login.jsp").forward(request, response);
    }

    @RequestMapping("authLogout")
import javax.servlet.http.HttpSession;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;

@Controller
public class AuthController extends HttpServlet {
    @Autowired
    private UserService userService;

    @RequestMapping("authLogin")
    public void login(HttpServletResponse response, HttpServletRequest request) throws IOException, ServletException {
        String username = Util.decode(request, "username");
        String password = Util.decode(request, "password");

        String validationCode = Util.decode(request, "validationCode");
        if (validationCode != null && !validationCode.equals(request.getSession().getAttribute("validationCode"))) {//验证码不通过
            request.getSession().setAttribute("alert_msg", "错误:验证码不正确!");
            request.getRequestDispatcher("login.jsp").forward(request, response);
            return;
    }

    public int getEnd() {
        return end;
    }

    public void setEnd(int end) {
        this.end = end;
    }

    public String getServlet() {
        return servlet;
    }

    public void setServlet(String servlet) {
        <br>
    </div>
    <br>
    <form action="userEdit" method="post" onsubmit="return check()">
        <input type="hidden" id="id" name="id" value="${vo.id}"/>
        
        <table class="index-content-table-add">
            <tr>
                <td width="12%">用户名:</td><td><input class="index-content-table-td-add" type="text" id="username" name="username" value="${vo.username}"/></td>
            </tr>
            <tr>
                <td width="12%">密码:</td><td><input class="index-content-table-td-add" type="text" id="password" name="password" value="${vo.password}"/></td>
            </tr>
            <tr>
                <td width="12%">姓名:</td><td><input class="index-content-table-td-add" type="text" id="realName" name="realName" value="${vo.realName}"/></td>
        this.redirectList(request, response);
    }

    /**
     * 获取公告的详细信息(详情页面与编辑页面要显示该公告的详情)并跳转回页面
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping({"noticeGet", "noticeEditPre"})
    public void get(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");//取出主键id
        Notice vo = noticeService.get(id);
        request.getSession().setAttribute("vo", vo);
        String to = request.getRequestURI().toLowerCase().contains("get") ? "info" : "edit";//判断是去详情显示页面还是编辑页面
        response.sendRedirect("notice_" + to + ".jsp");
    }

    /**

    public void setId(Long id) {
        this.id = id;
    }
    public String getJingdianName() {
        return jingdianName;
    }

    public void setJingdianName(String jingdianName) {
        this.jingdianName = jingdianName;
    }
    public String getJingdianAddress() {
        return jingdianAddress;
    }

    public void setJingdianAddress(String jingdianAddress) {
        this.jingdianAddress = jingdianAddress;
    }
    public String getJingdianPhone() {
        return jingdianPhone;
    }

    public void setJingdianPhone(String jingdianPhone) {
     */
    @RequestMapping("noticeAdd")
    public void add(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Notice vo = new Notice();
        //取出页面传进来的参数
        vo.setNoticeName(Util.decode(request, "noticeName"));
        vo.setNoticeText(Util.decode(request, "noticeText"));
        vo.setNoticeType(Util.decode(request, "noticeType"));
        vo.setCreateDate(Util.decode(request, "createDate"));
        //调用Service层的增加(insert)方法
        noticeService.insert(vo);
        this.redirectList(request, response);
    }

运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap.

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、景点模块、线路模块的增删改查管理

20220319010046

20220319010047

20220319010048

20220319010049

20220319010050

20220319010051

20220319010052

20220319010053

20220319010054

20220319010055

document

举报

相关推荐

0 条评论