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

    互联网开发技术第六讲Web技术.ppt

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

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

    互联网开发技术第六讲Web技术.ppt

    互联网开发技术Internet Systems Development Technologies,蔡 剑,Ph.D.Assistant Professor in Management Science and E-BusinessGuanghua School of ManagementPeking University,本讲内容,Web层技术(II)Servlet 的新功能JSP 技术About The Course Project:Proposal due one week after midtermSchedule meetings with groups next week About The Midterm:Time:10/31(First 1.5 hours)Questions:choices,analysisCovers lecture 1-6(book p1-208),Review:J2EE Framework,Review:Servlet Process,Review:Collaboration,A Context is the Domain of An Application,Context,http:/yourip:8080/icamples/password,http:/yourip:8080/jsp-examples/*,Servlets Call Each Other,Get RequestDispatcher from HttpServletRequest:RequestDispatcher desp=req.getRequestDispatcher(“/target”)2.Get RequestDispatcher from ServletContext:ServletContext context=req.getSession().getServletContext()RequestDispatcher desp=context.getRequestDispatcher(“/target”)3.Get ServletContext for another application,then get RequestDispatcher:ServletContext context2=context.getContext(/icwork);RequestDispatcher desp=context2.getRequestDispatcher(“/target”);,To Load Another Servlet,despatcher.forward(req,resp);response.sendRedirect(targetURL);Difference?,HTTP/1.1 200 OK Content-Type:text/html Transfer-Encoding:chunked Date:Thu,17 Oct 2002 20:42:53 GMT Server:Apache Coyote HTTP/1.1 Connector48f,HTTP/1.1 302 Moved Temporarily Content-Type:text/html Location:http:/Transfer-Encoding:chunked Date:Thu,17 Oct 2002 20:40:23 GMT Server:Apache Coyote HTTP/1.1 Connect2d8 Java Web Services Developer,Filters,Filter Functions,对网络请求进行分析,对输入数据进行预处理阻止请求和响应的进行根据功能改动请求的头信息和数据体.根据功能改动响应的头信息和数据体.和其他网络资源协作,Filter Chain,Filter Setup in Web.xml,filter.jpgSimpleFilterASimpleFilter The first filter samplejwadbook.SimpleFilter param1 value1SimpleFilter/path/index.jsp,Filter Example,P109,Filter to Check Password,Security Filter,Action Listener,serlvet的事件监听器接口能够处理ServletContext,HttpSession,ServletRequest的生命周期和属性变化事件,Data Base Connection,Database,SQL,Data resource,JDBC Connection,JDBC Connection,1.Use JDBC DriverPut driver.jar in/common/system/libClass.forName(“com.pointbase.jdbc.jdbcUniversalDriver”);2.Make database connectionString pointbaseURL=jdbc:pointbase:server:/+host+/+databaseName;DriverManager.getConnection(pointbaseURL,username,password);,JDBC Connection(cont),3.Create SQL commandStatement stmt=connection.createStatement();String queryString=SELECT userid,lastname,addtime FROM Usertable ORDER BY userid;);ResultSet result=stmt.executeQuery(queryString);4.Analyze returned resultswhile(resultset.next()userID=resultset.getInt(userid);lastName=resultset.getString(lastname);addDate=resultset.getDate(addtime);5.Close database connectionconnection.close();,Connection Pool,Use Database Resources,1.Add JDBC driver2.Set server.xml(p160)3.Define database parameters DataSource reference to WorkflowAppDb defined in server.xml jdbc/WorkflowAppDb javax.sql.DataSource Container,Use Database Resources(cont),4.Use resource in ServletsDataSource dsource=(DataSource)ctx.lookup(java:comp/env/jdbc/WorkflowAppDb);if(dsource!=null)Connection conn=dsource.getConnection();if(conn!=null)Statement stmt=conn.createStatement();ResultSet rst=stmt.executeQuery(select*from Concept order by ConceptID);,JSP Technologies,A Simple JSP,Method:URI:Protocol:,JSP Result,Implicit Objects,JSP Grammar,DirectivesInclude Directive Page Directive Taglib Directive Scripting ElementsDeclarations Expressions Scriptlet,JSP Grammar,Comments Actions,An Example of Directives,Include Date JSP The current date and time aredate.jsp:,An Example of Scripting Elements,Welcome!Good Morning!12)&(currenthour Good Afternoon!Good Evening!,An Example of Actions,Include Date JSP at Request TimeThe current date and time aredate2.jsp:Getting date.,Use JavaBeans with JSP,JSP handles the face.JavaBean handles the logic and complexity.,A Example of Using JavaBean,Use Bean in JSP to Calculate 你一般每天需要 卡能量,How to Write the JavaBean,public class CalMeasure/properties defined public CalMeasure()public int getProperty()return this.proerty;public void setProperty(type value)this.property=value;Other method,Exercises 3,Programming:Create a database in pointbase,setup a table with the name,studentid,major,and contact of your group,display these contents with a servlet or jsp.(Extra credit:if user can modify the data-base information through a browser,I.E.add/update),

    注意事项

    本文(互联网开发技术第六讲Web技术.ppt)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

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




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开