欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > DOC文档下载  

    Web数据库作业报告网上书店网页制作.doc

    • 资源ID:2881159       资源大小:2.49MB        全文页数:31页
    • 资源格式: DOC        下载积分:8金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要8金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Web数据库作业报告网上书店网页制作.doc

    Web数据库 期末作业报告网上书店网页制作 实现软件:netbeans+mySql实现方式:jsf数据库准备:说明:数据库表是根据书上的建立的,有一些我没理解他的用途,自己建了购物车(Cart)的表。Book_count 用来表示对应书本顾客的购物车中的量。Total 表示对应书本的总价,isorder本来是要用来判断是否是已经生成订单的,最后还是没有用到,因为下订单的模块没有实现。图片准备:因为页面布局能力也是很弱,所以参考其他的书本 顺便用了下图。网页建设:时间、水平有限 实现部分。Persistence.Xml 配置: 数据源配置被忽略 浪费了我很多时间。网上书店网页实现 (截图):用户注册页面:用户登录界面:用户注册、登录页的实现主要是用实体类生成的表单,再加以改进得到。用户登录后:用户购物车:图书查询结果:说明:本来的意图是浏览者只有登录后才能将商品加入购物车,但是最后感觉上程序是有对用户判断是否为空的,最后还是失败了,不知道为什么没我有判断成功。管理员注册页:管理员登录页:管理员与客户登录后,均是进入到主页,但是区别在于管理员多了一个管理图书的权限。管理员 添加图书:添加图书中由于图片添加的感觉过于繁琐,有些难办,花了好久还是没想到解决的放法,就放弃了。感想与总结:这个作业的完成花费了我很多时间,寝食难安,有时躺在床上还在纠结一个页面的设计,方法的实现。本来对于jsf什么的还是不懂,上课总是一头雾水,也许有作业才会使我有压力去学习吧,为此慢慢在书上找答案,找方法,还是有所收获的吧,至少知道了用实体类来操作数据库,jsf一些标签的使用。鉴于水平有限,只有实现了一小部分;临近期末时间有限,要把时间均匀分配,不能有太多的时间纠结了,不好意思,只能以此粗糙的作业上交,见谅见谅!代码: 由于一部分代码是由根据实体类有系统生成的,以下就将那部分代码省略了。下面先给出java代码:Bean(受管bean)包,主要有AdminMBean.java (用来操作管理员的动作),BookManagedBean.java(用来操作关于书本的动作) ,CartManagedBean.java(操作购物车) ,CustomerMBean。java(用来操作客户的动作)。以下只给出bean包和页面的代码。在 BsAdminFacade.Java和BsBookFacade.java中均有左边给出的返回实体em的方法,以备后面对应bean类中使用。AdminMBean.java 的代码: 省略包的导入, get, set 方法。BookManagedBean.java的代码: 省略包的导入, get, set 方法。CartManagedBean.java(操作购物车)的代码: 省略包的导入, get, set 方法。 CustomerMBean.java(用来操作客户的动作)的代码:省略包的导入,get,set方法。页面的代码adLogin.html的代码(管理员登录):Admin.html的代码(管理员注册): <?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml" xmlns:h=" xmlns:f=" xmlns:ui=" <h:head> <title>Facelet Title</title> </h:head> <h:body> <ui:composition template="layout.xhtml"> <ui:define name="top" ><ui:include src="top.xhtml"/></ui:define> <ui:define name="left" ></ui:define> <ui:define name="content" > <center> <f:view> <h:form> <h1><h:outputText value="管理员注册页"/></h1> <h:panelGrid columns="2"> <h:outputLabel value="用户名:" for="name" /> <h:inputText id="name" value="#amb.bsadmin.adminName" title="adminName" required="true" requiredMessage="用户名不能为空!"/> <h:outputLabel value="真实姓名" for="relname" /> <h:inputText id="relname" value="#amb.bsadmin.adminrealName" title="adminrealName" /> <h:outputLabel value="密码" for="pass" /> <h:inputSecret id="pass" value="#amb.bsadmin.adminPassword" title="adminPassword" required="true" requiredMessage="密码不能为空!"/> <h:outputLabel value="确认密码" for="repass" /> <h:inputSecret id="repass" value="#amb.repassword" title="adminPassword" required="true" requiredMessage="确认密码不能为空!"/> <h:commandButton value="保存" action="#amb.save"/> <h:commandButton value="新建" action="#amb.prepareCreate"/> <h:outputLabel style="color: #D20005" value="#amb.passError " /> </h:panelGrid> </h:form> </f:view> </center> </ui:define> <ui:define name="bottom" ><ui:include src="bottom.xhtml"/></ui:define> </ui:composition> </h:body></html>custLogin.html的代码:<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml" xmlns:h=" xmlns:ui=" xmlns:f=" <h:head> <title>Facelet Title</title> </h:head> <h:body> <ui:composition template="layout.xhtml"> <ui:define name="top" ><ui:include src="top.xhtml"/></ui:define> <ui:define name="left" >请文明网购。哦 ,亲</ui:define> <ui:define name="content" > <center> <f:view> <h:form> <h1><h:outputText value="用户登录"/></h1> <h:panelGrid columns="2"> <h:outputLabel value="用户名:" for="custName" /> <h:inputText id="custName" value="#cmbean.bscu.custName" title="CustName" required="true" requiredMessage="请输入用户名!" /> <h:outputLabel value="密 码:" for="custPassword" /> <h:inputSecret id="custPassword" value="#cmbean.bscu.custPassword" title="CustPassword" required="true" requiredMessage="请输入密码!"/> <h:commandButton value="登录" action="#cmbean.login"/> <h:commandButton value="新建" action="#cmbean.prepareCreate"/> </h:panelGrid> </h:form> </f:view> </center> </ui:define> <ui:define name="bottom" ><ui:include src="bottom.xhtml"/></ui:define> </ui:composition> </h:body></html>Customer.html的代码:<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml" xmlns:h=" xmlns:f=" xmlns:ui=" <h:head> <title>用户注册页面</title> </h:head> <h:body> <ui:composition template="layout.xhtml"> <ui:define name="top" ><ui:include src="top.xhtml"/></ui:define> <ui:define name="left" > <p><span>用户注册注意事项:</span></p> <p>热爱祖国热爱人民</p> <p>文明上网</p> <p>请记住您的密码、用户名</p> </ui:define> <ui:define name="content" > <center> <f:view> <h:form> <h1><h:outputText value="客户注册"/></h1> <h:panelGrid columns="2"> <h:outputLabel value="创建用户:" for="custName" /> <h:inputText id="custName" value="#cmbean.bscu.custName" title="CustName" required="true" requiredMessage="The CustId field is required."/> <h:outputLabel value="创建密码:" for="custPassword" /> <h:inputSecret id="custPassword" value="#cmbean.bscu.custPassword" title="CustPassword" /> <h:outputLabel value="确认密码:" for="recustPassword" /> <h:inputSecret id="recustPassword" value="#cmbean.repassword" title="reCustPassword" /> <h:outputLabel value="真实姓名:" for="custrealName" /> <h:inputText id="custrealName" value="#cmbean.bscu.custrealName" title="CustrealName" /> <h:outputLabel value="电话号码:" for="custPhone" /> <h:inputText id="custPhone" value="#cmbean.bscu.custPhone" title="CustPhone" /> <h:outputLabel value="电子邮箱:" for="custEmail" /> <h:inputText id="custEmail" value="#cmbean.bscu.custEmail" title="CustEmail" /> <h:outputLabel value="所在地址:" for="custAddress" /> <h:inputText id="custAddress" value="#cmbean.bscu.custAddress" title="CustAddress" /> <h:outputLabel value="邮政编码:" for="custZipcode" /> <h:inputText id="custZipcode" value="#cmbean.bscu.custZipcode" title="CustZipcode" /> <h:commandButton value="注册" action="#cmbean.regist"/> <h:commandButton value="新建" action="#cmbean.prepareCreate"/> </h:panelGrid> <h:outputLabel style="color: #D20005" value="#cmbean.passError " /> </h:form> </f:view> </center> </ui:define> <ui:define name="bottom" ><ui:include src="bottom.xhtml"/></ui:define> </ui:composition> </h:body></html>Index.html的代码:<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml" xmlns:h=" xmlns:ui=" xmlns:f=" xmlns:c=" <h:head> <title>网上书店首页</title> </h:head> <h:body> <ui:composition template="layout.xhtml"> <ui:define name="top" ><ui:include src="top.xhtml"/></ui:define> <ui:define name="left" ><ui:include src="left.xhtml"/></ui:define> <ui:define name="content" > <f:view> <table> <tr> <td> <h:form>图书查询: 书名:<h:inputText id="bookName" value="#bookMB.bsbook.bookName" title="BookName"/> <h:commandButton value="查询" action="#bookMB.queryBookList"/> </h:form></td></tr> <tr><td><h:outputText value="图书分类"/></td></tr> </table> <c:forEach var="item" items="#bookMB.bookList"> <table height="130" > <tr> <td> <table> <tr><td> <h:graphicImage value="#item.bookPicture" width="85" height="125"/></td> </tr> </table> </td> <td><table> <tr><td>书名:<h:outputText value="#item.bookName"/></td><td>&nbsp;</td> <td>类别:<h:outputText value="#bookMB.setCateName(item.catId)"/></td></tr> <tr><td>作者:<h:outputText value="#item.bookAuthor"/></td><td></td> <td>出版社:<h:outputText value="#item.bookPublisher"/></td> </tr> <tr><td>优惠价:<h:outputText value="#item.bookPrice*item.bookDiscount/100"/></td><td></td> <td>定价:<h:outputText value="#item.bookPrice"/></td> </tr> <tr><td>折扣:<h:outputText value="#item.bookDiscount折"/></td><td></td> <td>剩余库存:<h:outputText value="#item.bookCount"/></td> </tr> <tr> <td>描述:<h:outputText value="#item.bookDesc"/></td> </tr> <tr> <td>描述:<h:outputText value="#item.bookDesc"/></td> </tr> </table></td> </tr> <tr><td><h:form> <h:commandButton action="#cartMB.addCart(cmbean.bscu.custName,item.bookId)" value="加入购物车"/> </h:form> </td></tr> </table><h:graphicImage value="images/line.gif" /> </c:forEach> </f:view> </ui:define> <ui:define name="bottom" ><ui:include src="bottom.xhtml"/></ui:define> </ui:composition> </h:body></html>queryResult.html的代码(查询结果):<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "http:/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http:/www.w3.org/1999/xhtml" xmlns:h=" xmlns:c=" xmlns:ui=" <h:head> <title>Facelet Title</title> </h:head> <h:body> <ui:composition template="layout.xhtml"> <ui:define name="top" ><ui:include src="top.xhtml"/></ui:define> <ui:define name="left" ><ui:include src="left.xhtml"/></ui:define> <ui:define name="content" > <h:outputText value="图书查询结果"/> <c:forEach var="item" items="#bookMB.querybklist"> <table height="130" > <tr> <td> <table> <tr><td> <h:graphicImage value="#item.bookPicture" width="85" height="125"/></td> </tr> </table> </td> <td><table> <tr><td>书名:<h:outputText value="#item.bookName"/></td><td></td> <td>类别:<h:outputText value="#bookMB.setCateName(item.catId)"/></td></tr> <tr><td>作者:<h:outputText value="#item.bookAuthor"/></td><td></td> <td>出版社:<h:outputText value="#item.bookPublisher"/></td> </tr> <tr><td>优惠价:<h:outputText value="#item.bookPrice*item.bookDiscount/100"/></td><td></td> <td>定价:<h:outputText value="#item.bookPrice"/></td> </tr> <tr><td>折扣:<h:outputText value="#item.bookDiscount折"/></td><td></td> <td>剩余库存:<h:outputText value="#item.bookCount"/></td>

    注意事项

    本文(Web数据库作业报告网上书店网页制作.doc)为本站会员(仙人指路1688)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开