欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    JSP程序设计实验报告.docx

    • 资源ID:7000789       资源大小:376.80KB        全文页数:37页
    • 资源格式: DOCX        下载积分:3金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要3金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

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

    JSP程序设计实验报告.docx

    1、JSP程序设计实验报告长江职业学院JSP语言程序设计实验指导书专 业: 学 号: 姓 名: 班 级: 指导 老师: 软件教研室 编实验一 .实验二 .实验三 .实验四 .实验五 .实验六 .实验七 . 实验一 Web编程环境一、实验目的1.搭建Web编程环境,能正确安装配置java运行环境、WEB服务器和数据库服务器2.熟悉WEB编程集成环境MYEclipse.3.熟练掌握WEB工程的创建、发布、运行流程。二、实验内容1.安装并配置java运行环境JDK和JRE2.安装Web服务器tomcat, 配置Tomcat服务器3.安装并配置数据库MySQL.4.安装MyEclispe,熟悉各项菜单项5

    2、.为MyEclispe集成配置JDK和Tomcat6.创建、发布、运行一个WEB工程。三、实验仪器及耗材计算机,JDK,TOMCAT, MySQL, MyEclipse等软件。四、实验步骤1、安装并配置JDK和JRE2、设置好classpath和path路径3、安装Tomcat5.54、设置Tomcat的配置属性5、安装并配置MySQL数据库6、安装MySqL Administrator工具7、安装MyEclipse8、新建并配置一个工程,运行发布一个新的工程。五、实验结果1、JDK、JRE安装结果:2、Classpath和path设置3、安装并配置Tomcat4、安装并配置MySqL和MyS

    3、qL Administrator 工具5、安装MyEclipse6、发布一个Web工程。六、实验心得实验二 HTML和CSS编程技术 一、实验目的1.熟悉HTML静态网页编程技术,熟悉HTML各种标记,特别是表单标记2.熟悉CSS编程技术,掌握CSS来格式化网页、掌握CSS盒式模型3.掌握DIV+CSS布局和设计网页,掌握CSS设计网页的一般流程4.熟悉Dreamweaver的CSS设计器二、实验内容1.构思一个新闻发布网站,主题自选,设计好新闻类别2.制作主页PSD图3.用DIV+CSS布局主页框架。(如可分成top, mid, foot, 其中mid再分两大块left和main)4.分别细

    4、化设计每一大块。5.要中间部分的左边或右边要设计一个小登录表单,并用CSS美化。三、实验仪器及耗材计算机,Dreamweaver 8,Photoshop,MyEclipse等软件。四、实验步骤1、制作PSD图2、使用DIV+CSS布局3、细化每一块4、美化表单部分五、实验结果1、制作PSD图2、使用DIV+CSS布局3、细化每一块4、美化表单部分六、实验心得实验三 JavaScript编程技术一、实验目的1.熟悉JavaScript语法2.掌握JavaScript函数的创建和调用3.熟悉JavaScript对象,特别是浏览器对象,了解DOM模型,知道文档对象的访问方法。4.会用JavaScri

    5、pt来对表单进行验证。二、实验内容1.用JavaScript完成对登录表单的验证2.设计一个新闻发布的页面,并用JavaScript对新闻发布表单进行验证。三、实验仪器及耗材计算机,Dreamweaver 8,Photoshop,MyEclipse等软件。四、实验步骤1、设计和实现对表单验证的过程代码如下:function checklogin()var user=document.getElementsByName(username)0.value;var pass=document.getElementsByName(password)0.value;if(user=)alert(请输入用

    6、户名);return false;else if(pass=)alert(请输入密码);return false;elsereturn true;2、设计和实现对新闻发布的验证过程代码如下:function checkarticle()var a=document.getElementsByName(author)0.value;var t=document.getElementsByName(title)0.value;var c=document.getElementsByName(content)0.value;if(a=)alert(请输入的作者);return false;if(t=

    7、)alert(请输入的标题);return false;else if(c=)alert(请输入的内容);return false;else return true;五、实验结果1、表单验证结果2、文章发布页面验证六、实验心得实验四 Servlet编程技术一、实验目的1.熟悉Servlet技术的创建和运行流程。2.会在web.xml配置Servlet的URL3.熟悉请求request和响应response接口4.熟悉请求转发接口requestDispatcher接口5.熟悉会话Session接口,掌握基于Session登录权限控制。二、实验内容完成一个基于Session的登录权限控制模块。要求

    8、:a)主页登录表单提交后转到Servlet进行处理,根据用户类型转到不同的页面。如果在用户名或密码不正确把登录表单包含进来b)对于某些页面必须登录才能访问,如新闻发布页面。如果没有登录则禁止访问,并重定向到登录页面。三、实验仪器及耗材计算机, MyEclipse等软件。四、实验步骤1、设计和实现一个登录表单2、设计和实现实现验证的Servlet,然后进行验证五、实验结果1、表单验证效果2、验证Servlet源代码public class LoginServlet extends HttpServlet /* * Constructor of the object. */ public Logi

    9、nServlet() super(); /* * Destruction of the servlet. */ public void destroy() super.destroy(); / Just puts destroy string in log / Put your code here /* * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * param request the request send

    10、 by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException res

    11、ponse.setContentType(text/html); PrintWriter out = response.getWriter(); out .println(); out.println(); out.println( A Servlet); out.println( ); out.print( This is ); out.print(this.getClass(); out.println(, using the GET method); out.println( ); out.println(); out.flush(); out.close(); /* * The doP

    12、ost method of the servlet. * * This method is called when a form has its tag value method equals to post. * * param request the request send by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException

    13、if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding(GBK); response.setContentType(text/html;charset=GBK); response.setCharacterEncoding(GBK); String username=request.getParameter(userna

    14、me); System.out.println(用户名:+username); MemberProcess mp=new MemberProcess(); if(mp.isExisted(username) String password=request.getParameter(password); System.out.println(输入的密码:+password); if(mp.validate(username,password) HttpSession session=request.getSession(true); Member m=mp.getMemberByName(use

    15、rname); session.setAttribute(userinfo, m); session.setAttribute(login, true); session.setAttribute(memberId, username); session.setAttribute(loginusername, username); if(request.getParameter(backpage)=null) request.getRequestDispatcher(index.jsp).forward(request, response); else request.getRequestDi

    16、spatcher(request.getParameter(backpage).forward(request, response); else request.setAttribute(loginresult,密码错误); request.getRequestDispatcher(member.jsp).forward(request, response); else request.setAttribute(loginresult,用户名不存在); request.getRequestDispatcher(login.jsp).forward(request, response); /*

    17、* Initialization of the servlet. * * throws ServletException if an error occurs */ public void init() throws ServletException / Put your code here 六、实验心得实验五 JSP编程技术一、实验目的6.熟悉JSP编译指令,动作标记。7.熟悉JSP的隐含对象8.正确理解request、session、application三个对象的作用域9.能正确处理汉字乱码问题10.能熟练使用JSP技术来编写网页二、实验内容1.编写一个文章类,用Myeclipse的工作

    18、自动产生getter和settet函数2.修改前面编写过的管理员的新闻发布页面,改成JSP页面要求如下:1)撰写界面至少包括文件标题,所属栏目、作者、内容几项2)界面用CSS进行美化3)每个输入框均应有name属性。4)权限控制,必须是管理员用户才能访问,跟前面实验的登录权限控制关联起来。 3.编写一个Servlet来处理新闻发布页面提交的表单要求:1)读取表单各项内容,并把存入一个文章对象中。2)把文章对象绑定在request对象中,并转发到新闻显示页面。3. 编写一个新闻显示页面。 要求: 1) 编写静态页面模板,页面用div+css设计2)设定文章对象已存在request对象中,取出文章

    19、对象3)把静态页面的内容改成动态内容,如标题,作者,内容等。三、实验仪器及耗材计算机,Dreamweaver 8,Photoshop,MyEclipse等软件。四、实验步骤1、设计和实现新闻发布系统的页面2、设计和实现后台的Servlet五、实验结果1、页面的实现2、Servlet的实现public class ArticleServlet extends HttpServlet private static final long serialVersionUID = 1L; public ArticleServlet() super(); public void destroy() supe

    20、r.destroy(); / Just puts destroy string in log / Put your code here /* * The doGet method of the servlet. * * This method is called when a form has its tag value method equals to get. * * param request the request send by the client to the server * param response the response send by the server to t

    21、he client * throws ServletException if an error occurred * throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException request.setCharacterEncoding(GBK); response.setCharacterEncoding(GBK); response.setCo

    22、ntentType(text/html;charset=GBK); ArticleBll ab=new ArticleBll(); String opType=request.getParameter(opType); if(opType=null) request.getRequestDispatcher(articlelist.jsp).forward(request, response); else if(opType.equals(see) String aid=request.getParameter(articleId); int id=0; try id=Integer.pars

    23、eInt(aid); catch(NumberFormatException e) id=1; Article a=ab.getArticle(id); request.setAttribute(article, a); request.getRequestDispatcher(article.jsp).forward(request, response); else if(opType.equals(seecmts) String aid=request.getParameter(articleId); int id=0; try id=Integer.parseInt(aid); catc

    24、h(NumberFormatException e) id=1; Vector cmts=ab.getComments(id); request.setAttribute(comments, cmts); request.getRequestDispatcher(allcomments.jsp?articleId=+id).forward(request, response); else if(opType.equals(remove) String aid=request.getParameter(articleId); int id=0; try id=Integer.parseInt(a

    25、id); catch(NumberFormatException e) id=1; new ArticleBll().remove(id); request.getRequestDispatcher(article.jsp?articleId=+id).forward(request, response); /* * The doPost method of the servlet. * * This method is called when a form has its tag value method equals to post. * * param request the reque

    26、st send by the client to the server * param response the response send by the server to the client * throws ServletException if an error occurred * throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOExcep

    27、tion request.setCharacterEncoding(GBK); response.setCharacterEncoding(GBK); response.setContentType(text/html;charset=GBK); String opType=request.getParameter(opType); if(opType=null) String aid=request.getParameter(articleId); int id=0; try id=Integer.parseInt(aid); catch(NumberFormatException e) id=1;


    注意事项

    本文(JSP程序设计实验报告.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

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




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开