ApplicationarchitecturesforInteractiveWebApplications交互式Web应用程序的应用程序架构

上传人:e****s 文档编号:251868860 上传时间:2024-11-10 格式:PPT 页数:33 大小:270KB
返回 下载 相关 举报
ApplicationarchitecturesforInteractiveWebApplications交互式Web应用程序的应用程序架构_第1页
第1页 / 共33页
ApplicationarchitecturesforInteractiveWebApplications交互式Web应用程序的应用程序架构_第2页
第2页 / 共33页
ApplicationarchitecturesforInteractiveWebApplications交互式Web应用程序的应用程序架构_第3页
第3页 / 共33页
点击查看更多>>
资源描述
Click to edit Master title style,Click to edit Master text styles,Second level,Third level,Fourth level,Fifth level,Application Architectures for Interactive Web Applications:Java JSP and Model/View/ControllerTechniques,Jeff Schmitt,November 16,2001,ABSTRACT,This talk is the report of my sabbatical leave during Spring 2001 in,which I explored some new techniques in using the Java language to,develop interactive web applications.,Java Server Pages technology(JSP)facilitates the development of,interactive websites with dynamically generated content.JSP programs,contain ordinary HTML tags mixed with Java code.Custom tag libraries,and Template processing are techniques which allow the Java code to be,isolated from the HTML.This application architecture is,based on the principles of Model/View/Controller.,Web Application Components,Client-typically a Web Browser,HTTP-request,response protocol between client and server,HTML files-static web content,Webserver-serves HTML files and,looks for certain request patterns,then forwards request to servlet engine,for example:,/servlet/*,Servlet Engine-supports execution of servlets,Servlet-handles request from client,generates response to client,JSP Engine-supports the compilation of files into Servlets,Web Application-a collection of HTML files,Servlets and JSP pages to implement an information system on the web.,Tiered Systems,Single Tier-Mainframe,LAN,Two Tier-Client-Server,INTERNET,Database,Server,Application,Server,Web,Server,N-Tier-Web Application,Servlet Lifecycle,init(),destroy(),service(),Servlet Sequence Diagram,Client,Webserver,Servlet,request(),init(),destroy(),service(),Process request,response,response,Servlet Multithreading,Client 1,Servlet,request,Client 2,request,response,response,ServletsAdvantagesDisadvantages,Scalable,Persistent,Simple,Flexible,Support,Stable API,Run in separate memory space from Server,Servlet mapping(servlet is not a web page),Hard for Web Designer to change the HTML part of the code,HTML(presentation)and Java code(business logic)mixed together,XML Notation,Begin and end within same tag:,Begin and end as two separate tags:,Document Type Definition,Deployment Descriptor:web.xml,SnoopServlet test.SnoopServlet -454677,SnoopServlet SnoopServlet,SnoopServlet /snoop/*,:/jakarta.apache.org/taglibs/dbtags/WEB-INF/dbtags.tld,JSP-Java Server Pages,Similar to servlets,but they resemble HTML pages,Placed in web folders mixed with HTML files,acts like an HTML file,Compiled automatically to a servlet when first referenced or when the file is changed by programmer.,Intended to help separate the presentation(HTML response)from the logic(processing logic).,Similar to Microsofts Application Server Pages(ASP),JSP Lifecycle,Client,Webserver,Servlet,request,service(),init(),Process request,response,response,JSP,request,JSP to Servlet,Compile Servlet,servlet,JSP scripting elements,JSP Comments,Declarations:placed in static part of servlet,Expressions:evaluate to a string,Scriptlets:any Java statements,Template Text:inserted into response,Name:,JSP Default Objects,Object,Class,Scope,Comments,request,HttpServletRequest,Request,The client request,response,HttpServletResponse,Page,The servlet response,out,JspWriter,page,An object for writing to the output stream,session,HttpSession,Session,Created to track same user as they visit and return to pages in web application,application,ServletContext,Application,Allows servlets to communicate with each other,JSP Object Scope,Scope,Meaning,Page,Available to the handling page only,Request,Available to the handling page and to any servlelt or JSP that control is forwarded to or included,Session,Available to any servlet or JSP within the same session(across repeat visits to web application),Application,Available to any servlet or JSP within the same web application,Custom JSP tags,Assemble reusable JSP code for easy use,An XML-like front end to access Java programming,Designed to bridge the intersection between java programmers and web designers,Tag library holds definitions of custom tags,Custom tags save in Tag Library File,.tld,Many useful Tag Libraries exist for the common tasks such as database access,email,file access,DBTags,From Apache Jakarta project,Allow use of JDBC with Java details hidden,Easy to use,Invisible exception handling,establish connection to server,jdbc:mysql:/localhost/test,org.gjt.mm.mysql.Driver,root,notVerySecure,Statement and Query,The escapeSql tag can be used inside a SQL query to SQL-escape your input values if they contain single quotes.,insert into test_books(id,name)values(3,),select id,name,description from test_books order by 1,no description,JSP Action Elements,Control Tags for request-time include,Optional parameters for Control tags,Allow JSP programs to implement the Controller aspect of the Model-View-Controller architecture,JSP Forward,Client,Webserver,Servlet 1,request,service(),Process,request,response,response,JSP,request,JSP to Servlet,Compile Servlet,servlet,Servlet 2,reque
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业管理 > 商业计划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!