• 大小: 3.02MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-10
  • 语言: Java
  • 标签: Java  

资源简介

在线电影院购票系统(源码!基于jsp+js+sqlserver适合初学者)对于刚学习jsp的初学者帮助比较大,里面涉及jsp的知识比较全面,系统功能还没有完善,留给学者自己发挥!有问题可留言!

资源截图

代码片段和文件信息

package com.kk.contrall;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.kk.doma.Cinemas;
import com.kk.servic.AdminClCenter;

/**
 * Servlet implementation class AdminCenterServlet
 */
@WebServlet(“/AdminCenterServlet“)
public class AdminCenterServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public AdminCenterServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

/**
 * @see HttpServlet#doGet(HttpServletRequest request HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
request.setCharacterEncoding(“utf-8“);
response.setContentType(“text/html ;charset=utf-8“);
PrintWriter out = response.getWriter();

//接收
String yingyuanG = request.getParameter(“name“);
String yingpianG = request.getParameter(“name“);
String yingpingG = request.getParameter(“name“);
String yonghuG = request.getParameter(“name“);
String exitG = request.getParameter(“name“);

System.out.println(“yingyuanG=“+yingyuanG);

//判断
if(“yingyuanG“.equals(yingyuanG)) {   //显示所有影院,这里要用到分页   
//准备数据,页数,页面总数,每页要显示的数据
int pageNow = 1;
int pageSize = 3;
int pageCount = 0;

ArrayList al = new ArrayList<>();

AdminClCenter adminClCenter = new AdminClCenter();
pageCount = adminClCenter.getPageCount(pageSize);           //得到总页数
System.out.println(“pageCount1==“+pageCount);
al = adminClCenter.showYingYuan(pageSize pageNow);

request.setAttribute( “pageCount“pageCount+““);    //要转换
request.setAttribute( “al“al);


request.getRequestDispatcher(“/WEB-INF/yingyuanG.jsp“).forward(request response);

}else if(“yingpianG“.equals(yingpianG)) {
request.getRequestDispatcher(“/WEB-INF/yingpianG.jsp“).forward(request response);

}else if(“yingpingG“.equals(yingpingG)) {
request.getRequestDispatcher(“/WEB-INF/yingpingG.jsp“).forward(request response);

}else if(“yonghuG“.equals(yonghuG)) {
request.getRequestDispatcher(“/WEB-INF/yonghuG.jsp“).forward(request response);

}else if(“exitG“.equals(exitG)) {

request.getRequestDispatcher(“/WEB-INF/ShouYe2.jsp“).forward(request response);

}




}

/**
 * @see HttpServlet#doPost(HttpServletRequest request HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
// TODO Auto-generated method stub
doGet(request 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-12 20:49  K-YonhCinema2\
     文件         736  2018-06-06 21:12  K-YonhCinema2\.classpath
     文件         913  2017-08-13 16:54  K-YonhCinema2\.project
     目录           0  2018-06-12 20:49  K-YonhCinema2\.settings\
     文件         567  2017-08-13 16:54  K-YonhCinema2\.settings\.jsdtscope
     文件         177  2018-06-09 10:23  K-YonhCinema2\.settings\org.eclipse.core.resources.prefs
     文件         364  2017-08-13 16:54  K-YonhCinema2\.settings\org.eclipse.jdt.core.prefs
     文件         491  2017-08-13 16:54  K-YonhCinema2\.settings\org.eclipse.wst.common.component
     文件         345  2017-08-13 16:54  K-YonhCinema2\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-08-13 16:54  K-YonhCinema2\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-08-13 16:54  K-YonhCinema2\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\classes\
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\classes\com\
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\classes\com\kk\
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\classes\com\kk\contrall\
     文件        3310  2018-06-12 20:41  K-YonhCinema2\build\classes\com\kk\contrall\AdminCenterServlet.class
     文件        3833  2018-06-12 19:55  K-YonhCinema2\build\classes\com\kk\contrall\AdminClCenterServlet.class
     文件        2337  2018-06-12 20:23  K-YonhCinema2\build\classes\com\kk\contrall\AdminLoginServlet.class
     文件        3347  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\LoginClServlet1.class
     文件        2304  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\OrderClServlet.class
     文件        2958  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\PaySuessedServlet.class
     文件        2350  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\PingLunServlet.class
     文件        2613  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\ShanDianbuyTicksServlet.class
     文件        4567  2018-06-12 20:41  K-YonhCinema2\build\classes\com\kk\contrall\ShouYeClServlet.class
     文件        2916  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\ShowDetailServlet.class
     文件        4029  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\VipCenterServlet.class
     文件        3009  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\XuanZuoServlet.class
     文件        3162  2018-06-08 06:50  K-YonhCinema2\build\classes\com\kk\contrall\ZhuCeServlet.class
     目录           0  2018-06-12 20:49  K-YonhCinema2\build\classes\com\kk\doma\
     文件        1308  2018-06-08 15:54  K-YonhCinema2\build\classes\com\kk\doma\Admin.class
............此处省略142个文件信息

评论

共有 条评论