当前位置: 首页 > news >正文

长沙建个网站一般需要多少钱wordpress 数据导出

长沙建个网站一般需要多少钱,wordpress 数据导出,wordpress游戏,手机版网站开发框架版权声明 本文原创作者#xff1a;谷哥的小弟作者博客地址#xff1a;http://blog.csdn.net/lfdfhl 在本教程教程中#xff0c;我们实现学生列表的显示。 Student 请在bean包下创建Student类#xff0c;代码如下#xff1a; package com.cn.bean; /*** 本文作者#… 版权声明 本文原创作者谷哥的小弟作者博客地址http://blog.csdn.net/lfdfhl 在本教程教程中我们实现学生列表的显示。 Student 请在bean包下创建Student类代码如下 package com.cn.bean; /*** 本文作者谷哥的小弟* 博客地址http://blog.csdn.net/lfdfhl*/ public class Student {private int id;private String name;private int age;private String gender;private String hobby;public Student() {}public Student(int id, String name, int age, String gender, String hobby) {this.id id;this.name name;this.age age;this.gender gender;this.hobby hobby;}public int getId() {return id;}public void setId(int id) {this.id id;}public String getName() {return name;}public void setName(String name) {this.name name;}public int getAge() {return age;}public void setAge(int age) {this.age age;}public String getGender() {return gender;}public void setGender(String gender) {this.gender gender;}public String getHobby() {return hobby;}public void setHobby(String hobby) {this.hobby hobby;}Overridepublic String toString() {return Student{ id id , name name \ , age age , gender gender \ , hobby hobby \ };} } 图示如下 ShowStudentServlet 请在servlet包下创建ShowStudentServlet当查询到所有学生后将请求转发至学生列表页面。 代码如下 package com.cn.servlet;import com.cn.util.C3P0Utils; import com.cn.bean.Student; import javax.servlet.RequestDispatcher; 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 java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList;WebServlet(name ShowStudentServlet, urlPatterns /ShowStudentServlet) public class ShowStudentServlet extends HttpServlet {Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {doPost(request, response);}Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {ArrayListStudent studentArrayList new ArrayList();Connection connection null;PreparedStatement preparedStatement null;ResultSet resultSet null;try {connection C3P0Utils.getConnection();String sql SELECT * FROM student;preparedStatement connection.prepareStatement(sql);resultSet preparedStatement.executeQuery();while (resultSet.next()) {int id resultSet.getInt(id);String name resultSet.getString(name);int age resultSet.getInt(age);String gender resultSet.getString(gender);String hobby resultSet.getString(hobby);Student student new Student(id, name, age, gender, hobby);studentArrayList.add(student);}} catch (Exception e) {e.printStackTrace();} finally {C3P0Utils.release(connection, preparedStatement, resultSet);}request.setAttribute(students, studentArrayList);RequestDispatcher requestDispatcher request.getRequestDispatcher(/studentList.jsp);requestDispatcher.forward(request, response);} }图示如下 学生列表页面 请在web文件夹下创建学生列表页面studentList.jsp代码如下 % taglib urihttp://java.sun.com/jsp/jstl/core prefixc % % page contentTypetext/html;charsetUTF-8 languagejava % html headtitle学生列表/titlestyle typetext/csstr {text-align: center;}.out {display: inline-flex;}/stylescript typetext/javascriptfunction logout() {window.location.href ${pageContext.request.contextPath}/LogoutServlet;}function showStudent() {window.location.href ${pageContext.request.contextPath}/ShowStudentServlet;}function addStudent() {window.location.href ${pageContext.request.contextPath}/studentAdd.jsp;}function updateStudent(id) {window.location.href ${pageContext.request.contextPath}/QueryStudentServlet?id id;}function deleteStudent(id) {let flag window.confirm(您确定要删除吗);if (flag) {window.location.href ${pageContext.request.contextPath}/DeleteStudentServlet?id id;}}/script /head body background-color#e2e6c2 %--欢迎登录--% div idwelcomeh5欢迎${user.username}/h5 /div div aligncenterform action${pageContext.request.contextPath}/SearchStudentServlet methodpost%--搜索学生--%input typetext namecontent placeholder请输入姓名或学号input typesubmit value搜索/form%--新增学生--%input typebutton namecreate value新增 onclickaddStudent()/%--刷新学生列表--%input typebutton nameshowList value刷新 onclickshowStudent()/%--退出登录--%input typebutton namelogout value退出 onclicklogout()/ /div br/%--学生列表--% table border1 cellpadding5px cellspacing0px aligncentertrth学号/thth姓名/thth年龄/thth性别/thth爱好/thth操作/thth操作/th/trc:forEach varstudent items${students}trtd${student.id}/tdtd${student.name}/tdtd${student.age}/tdtd${student.gender}/tdtd${student.hobby}/tdtdinput idupdate typebutton value修改 onclickupdateStudent(${student.id})//tdtdinput iddelete typebutton value删除 onclickdeleteStudent(${student.id})//td/tr/c:forEach /table /body /html 图示如下 学生列表显示效果如下图所示
http://www.zqtcl.cn/news/582327/

相关文章:

  • 构建网站需要会什么意思辽宁省朝阳网站建设
  • 网站建设捌金手指专业1公司域名邮箱注册
  • 建设工程协会网站建设工程合同属于专属管辖吗
  • 网站建设费可分摊几年电子商务网站建设基础
  • wordpress api 发贴北京网站优化seo
  • 青岛网站制作服务商wordpress红包
  • 网站响应式设计如何提高网站文章收录
  • 网站 橙色如何做自己网站的seo
  • 网上商城网站建设公司兰州网站制作公司怎么样
  • 网站的动态图怎么做的获取网站访客qq
  • 黑龙江网站建站建设知名品牌形象设计公司
  • 网站建设去哪可接单怎么做微信小程序平台
  • 做外贸重新设计网站兰州网站建设慕枫
  • 服装销售 网站建设论文搭建企业网站需要什么
  • cnnic网站备案html网站建设代码
  • 金华网站建设明细报价表c苏宁网站开发
  • 在手机上怎么做微电影网站湖南人工智能建站系统软件
  • 网站做的一样算侵权吗站群建站系统
  • 骨干专业建设验收网站xueui wordpress
  • 宁波高质量品牌网站设计厂家世界上有php应用的网站
  • 网站平台建设的重要性响应式网站切图
  • 近期做网站需要什么软件网站制作常见的问题
  • vs做的本地网站甘肃省建设厅门户网站
  • 网站建设合同义务wordpress m1
  • 青海省建设局网站首页wordpress模板建站教程视频
  • 演示 又一个wordpress站点静态页面加wordpress
  • 企业做淘宝客网站有哪些有网站吗给一个
  • 深圳网站制作公司信息之梦与wordpress哪个好用
  • 免费搭建商城网站山西制作网站公司排名
  • 网站开发免费中建建设银行网站