书签 分享 收藏 举报 版权申诉 / 37

类型jsp+javaBean+servlet+mysql.docx

  • 文档编号:11369116
  • 上传时间:2023-02-28
  • 格式:DOCX
  • 页数:37
  • 大小:156.42KB

list.jsp

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%@taglibprefix="c"uri="

<%@pageimport="exercise.yu.bean.UserBean"%>

<%

Stringpath=request.getContextPath();

StringbasePath=request.getScheme()+":

//"+request.getServerName()+":

"+request.getServerPort()+path+"/";

%>

DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">

">

MyJSP'list.jsp'startingpage

functionviewlist(){

document.getElementById('d1').style.display='';

document.getElementById('d2').style.display='none';

}

functionaddview(){

document.getElementById('d1').style.display='none';

document.getElementById('d2').style.display='';

}

30px;">

user表列表信息      

序号

院系

专业

年龄

性别

QQ

电话

操作

forEachvar="bean"items="${ulist}">

${bean.id}

${bean.yx}

${bean.zy}

${bean.age}

${bean.sex}

${bean.dh}

${bean.qq}

id=${bean.id}">修改    

id=${bean.id}">删除

forEach>

30px;">

user信息填写

院系

专业

年龄

性别

电话

QQ

        

update.jsp

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%@pageimport="exercise.yu.bean.*"%>

<%@taglibprefix="c"uri="

<%

Stringpath=request.getContextPath();

StringbasePath=request.getScheme()+":

//"+request.getServerName()+":

"+request.getServerPort()+path+"/";

%>

DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">

">

MyJSP'update.jsp'startingpage

.table1{

margin:

0auto;

border-collapse:

collapse;

}

.table1td{

padding:

0px;

height:

25px;

border:

1pxsolid#6AB6B6;

text-align:

center;

font-family:

"微软雅黑";

font-size:

12px;

background-color:

#EAFEFE;

}

.table1td.title{

height:

28px;

color:

#fff;

background-color:

#6AB6B6;

font-weight:

bold;

font-size:

20px;

text-align:

center;

}

.table1tr.colname{

font-size:

14px;

font-weight:

bold;

}

*.nobd_tabletd{

border:

none;

}

30px;"id="add">

user信息填写

院系

专业

年龄

电话

QQ

性别

setvalue="男"var="sexs">

set>

iftest="${userBean.sexeqsexs}">

if>

iftest="${userBean.sexnesexs}">

if>

        

window.history.go(-1);">

javaBean:

packageexercise.yu.bean;

/**

*@ClassName:

UserBean

*@Description:

TODO(使用者属性的bean)

*@author******

*@date:

2014-6-11下午7:

43:

20

*/

publicclassUserBean{

privateintid;

privateStringyx;//院系

privateStringzy;//专业

privateStringsex;//性别

privateStringdh;//电话

privateStringqq;//扣扣

privateintage;//年龄

publicUserBean(){

}

publicStringgetYx(){

returnyx;

}

publicvoidsetYx(Stringyx){

this.yx=yx;

}

publicStringgetZy(){

returnzy;

}

publicvoidsetZy(Stringzy){

this.zy=zy;

}

publicStringgetSex(){

returnsex;

}

publicvoidsetSex(Stringsex){

this.sex=sex;

}

publicStringgetDh(){

returndh;

}

publicvoidsetDh(Stringdh){

this.dh=dh;

}

publicStringgetQq(){

returnqq;

}

publicvoidsetQq(Stringqq){

this.qq=qq;

}

publicintgetAge(){

returnage;

}

publicvoidsetAge(intage){

this.age=age;

}

publicintgetId(){

returnid;

}

publicvoidsetId(intid){

this.id=id;

}

}

Servlet:

packageexercise.yu.servlet;

importjava.io.IOException;

importjavax.servlet.ServletException;

importjavax.servlet.http.HttpServlet;

importjavax.servlet.http.HttpServletRequest;

importjavax.servlet.http.HttpServletResponse;

importexercise.yu.bean.UserBean;

importexercise.yu.dao.UserDao;

/**

*@ClassName:

InsertOrUpdateServlet

*@Description:

TODO()

*@author******

*@date:

2014-6-12下午8:

34:

23

*/

publicclassInsertOrUpdateServletextendsHttpServlet{

privatestaticfinallongserialVersionUID=1L;

privateUserDaouserDao;

publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)

配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
jsp javaBean servlet mysql
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:jsp+javaBean+servlet+mysql.docx
链接地址:https://www.bdocx.com/doc/11369116.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开