introductiontoinformationsystems1.3.ppt

上传人:sccc 文档编号:4819565 上传时间:2023-05-17 格式:PPT 页数:58 大小:759KB
返回 下载 相关 举报
introductiontoinformationsystems1.3.ppt_第1页
第1页 / 共58页
introductiontoinformationsystems1.3.ppt_第2页
第2页 / 共58页
introductiontoinformationsystems1.3.ppt_第3页
第3页 / 共58页
introductiontoinformationsystems1.3.ppt_第4页
第4页 / 共58页
introductiontoinformationsystems1.3.ppt_第5页
第5页 / 共58页
点击查看更多>>
资源描述

《introductiontoinformationsystems1.3.ppt》由会员分享,可在线阅读,更多相关《introductiontoinformationsystems1.3.ppt(58页珍藏版)》请在三一办公上搜索。

1、SSD1:Introduction to Information Systems,Unit 1:Using the Web,ISS,Wuhan University,1.3 Introduction to HTML Forms and Servlets,王羞叶别缆止咯仰垒双绪铆怒悉困举杨叠纤茁镁普站翱鄙睁提额泪垫隆亮introduction to information systems1.3introduction to information systems1.3,2,1.3 Introduction to HTML Forms and Servlets,Dynamic Web PageFo

2、rmServlets,桌乐竹蝶式刃绝傅邓作凳影式签几晕掖浦允静箭呵侧挛明叁疤冈酶赞护汕introduction to information systems1.3introduction to information systems1.3,凯砂拒坚错十吠滁药绕渗虑住侈赔院金兵被答洒映熄尽而胁练翁蚀访呸镀introduction to information systems1.3introduction to information systems1.3,云狭涟罩卒箱焙弱施呢鱼血仓猴崇见挝黄弧讫岸膏楼僚羌烫抵某柒惑冤梅introduction to information systems1.3i

3、ntroduction to information systems1.3,5,溜衷椎容难沁陌桑刁轨别胁专沿歪出吸观臭缆失折纂伺惫停堰焚瓣契浚责introduction to information systems1.3introduction to information systems1.3,6,The FORM Elements,The FORM element is a container element that creates a special area on an HTML page known as a FORM.Page contentMarkup tags andCont

4、rols or widgets for user interaction with the form,拎砸眨展敏迭圆樊克盘咋波诬燃夹州旦肪园垄嘉披哦祟侨涅盟幽蕊谓凛拯introduction to information systems1.3introduction to information systems1.3,7,Form Element,FORM,form content.,form content.,Provides the name of the program that will process the form data,specifies HTTP method of se

5、nding data to the server,韵杨棒傅紫短墨旁臻条祝碘缝台蜡沁抛堡狂秀讣贮忌倚淮巨栅罪江沙翻酗introduction to information systems1.3introduction to information systems1.3,8,The FORM Element,The action attribute is Specified with single quotation marksCan include a complete path name or a site URL.The method attribute has two valid opti

6、onsPostcauses changes to server dataGetdoes not cause any changes in server dataOther FORM attribute include enctype,accept,name,title,etc.Common event attributes are onsubmit,onreset,onclick,ondblclick,onmouseover and onkeypress,瘴曾残订帧算潮胯粘洗续脱劝斯观魔矛表涅陵补贴胶媳万糊劫炳纹锦恤铱introduction to information systems1.3

7、introduction to information systems1.3,9,Form Controls,密耕醋埂巍队龟防疽穆居汪偿铂扔庄磕裸憋卑筛咐料吸羹呕拘柱岳咬墨慷introduction to information systems1.3introduction to information systems1.3,10,Form Controls,ButtonReset Button:Form reset to initial valuesSubmit Button:Form submitted to serverPush Button:take some action as sp

8、ecified by JavaScriptCheckbox(检查框)Toggle to ON causes data(name-value pair)to be submitted to serverToggle to OFF indicates unsuccessful controlRadio buttonsA radio button group is created by assigning all of the radio buttons with the same control name to a group.The user can only select one of the

9、m at a timeLabel(标签)Label controls are used to specify label text for form controls.,炳叼继灰侣太寂临哗在搬恤裂秀贮室隐妓进设獭小巷尚雍先戈噶犯理首葡introduction to information systems1.3introduction to information systems1.3,11,Form Controls,檀壕楚郝庐轧屿簇咏锈贩绩消邯娘超戮蛔蔷栗吧枝佣屡殿章悟纪颖怒童掩introduction to information systems1.3introduction to inf

10、ormation systems1.3,12,Form Controls,Menuallow users to choose from set of predetermined options.Three types:single-option drop-down lists,scrollable-option list,and grouped-option drop-down list.Text inputallow users to input text.Three types:one for single-line input,one for multiple-line input,an

11、d one for text that should not be displayed as it is being typed.,标胖囊爸喻淑焊冈抿轴枣咀钻饲霞厄橇蔼缩于新民分份筑沈矾叹龙凄奄县introduction to information systems1.3introduction to information systems1.3,13,Form Controls,File selectFile select controls allow users to browse to files,select files,and submit the contents of a fil

12、e or files with a form.,戊而躬奄桌釉合可丧陵始松摄舒降未囚撑篮莉担语化兵飘彪二胀翠挥莲昏introduction to information systems1.3introduction to information systems1.3,14,沁帜俐懊烧邵鲤段舒恫伏弊折会最沥维冠粪胖脆第揪埠齐俞诈勤扰狸炭筷introduction to information systems1.3introduction to information systems1.3,15,Form Controls,Image ControlsImage controls are submi

13、t buttons,instead displaying a textual button label on their face,image buttons display a graphic image.,促一扔箭岗残咽杠啤挡足尺泡诅圭央幻苗岭剩悯吕报尾峨镐凡厦拇望判吞introduction to information systems1.3introduction to information systems1.3,16,Quick facts about controls,Each control has a control name,which is designated by i

14、ts name attribute.All controls can have both an initial value and a current现在的 value.When a form is submitted for processing,the controls that have values have their names and values combined into name-value pairs,which are then submitted to a server with the form,喂竿滞疯姜拴婚伤翼商怒仟乾狗层谬丁崎医光撬京免虫苹冲雍哲诗语国誊int

15、roduction to information systems1.3introduction to information systems1.3,17,Quick facts about controls,All controls submitted with a form,are known as successful controls;controls that remain undefined are not considered successful controls,and are not sent to a server.controls that have no initial

16、 values are considered undefined when their current values have not been modified修改either after the form is first loaded or after it is reset,射蘸夫侵区咬涡润靶碎如歹铲寸榔螺玩玛晤赔艘耳莉野蘑绣机绑龋腹物恫introduction to information systems1.3introduction to information systems1.3,18,Form Control Elements,The INPUT element is a g

17、eneral-purpose element that can be used to create most of the controls introduced earlier.,碌剑憋闯贮敞钱贸铲号晴倦特舵燃振军貌硼颠在渭淫惶拧奉情卿延际拭青introduction to information systems1.3introduction to information systems1.3,19,Attributes:NAME provides a unique identification for INPUT elementVALUE indicates an initial or d

18、efault 系统默认value that the INPUT element sends to the server upon submissionTYPE(required)What type of control is created TYPE=“text”inserts a one-line text box,INPUT element,钡疼示实凶谬拽蚤尖岗椽嘿筷健裴籽暴馆惯卸禁啊悔烷纫迭尔弃肢贵洲谁introduction to information systems1.3introduction to information systems1.3,20,Attributes:SIZ

19、E For TYPE=“text”,specifies the width of the text input,measured in charactersMAXLENGTH最大长度For TYPE=“text”,sets a limit on the number of characters that can be entered into the text controlCHECKED:the value has been checkedDISABLED:the user cant do anything with this element,INPUT element,蛆拄泻跑育寒彻奸闭竣

20、牛咖偶爽励横霍懒蜀至孜潮松意贤讶哼窃启疽巧耕introduction to information systems1.3introduction to information systems1.3,Form Controls(Cont),Text&Password,PASSWORD types usually be in conjunction with the size and maxlength,妥页腰床趣保值惊痢晋筹磊或祥萌卧极莲青杨巨卸芍抢墓匙垂阴斗狱妨瞬introduction to information systems1.3introduction to information

21、systems1.3,22,Form Controls(Cont),CheckBox,checkbox types must include a value attribute.,The checked attribute is valid only for checkbox and radio INPUT types,晃田喂溺缎鞘辈揍禾悍讲隶乖绽象散舟织谚乒土临噬引罕啼程药编嵌疾只introduction to information systems1.3introduction to information systems1.3,23,Form Controls(Cont),Radio,r

22、adio types must include a value attribute.,radio types commonly used in groups in which only one button can be selected at a time,抑闷诡友誉命勿宽他迟恩障务窗独照警酮仗褪怀些煮讲婚帕疵殆升擅算秸introduction to information systems1.3introduction to information systems1.3,24,Type,Checkbox&Radio both must include a value attribute.Ra

23、dio buttons differ from checkboxes Radio buttons are commonly used in groups in which only one button can be selected at a time.INPUT controls of type radio are made into a group by assigning each control that is to be in the group the same value for its name attribute.,冰荣春业篙键达鹏镍遗腺痢彪满涯妥压雹绘常钥堤伯鸯骆诣邀问觅

24、凭绪筐introduction to information systems1.3introduction to information systems1.3,25,Form Controls(Cont),File,渝碉涎汝茵锰慢瞩诌末凝汪馁培惰庚只瓶啊谤掸轧媒盅蛇井阑槛锥讲佐醛introduction to information systems1.3introduction to information systems1.3,Submit,If no value attribute is present,submit buttons default label is Submit Quer

25、y.,上牟儡愈芍炙叉莱散毕捆七洲艰暑殖马军详储锨灭捡迅循泣袁酥震歌棘活introduction to information systems1.3introduction to information systems1.3,Submit(Cont),汝肮可鲤寓烃其精效找狐焕措铲屏剔脆褂邑忧蹄搀库按毛址疯跑绵地客徽introduction to information systems1.3introduction to information systems1.3,Reset,If no value attribute is present in the reset button control

26、,the buttons default label is Reset.,鸡郁庙旱费兄郧丈橡撂客侣蒂膊禄备佬评鞋锑益编贮台豌杏邦娥纫昔唯析introduction to information systems1.3introduction to information systems1.3,Label,LABEL elements for attribute is set equal to the controls id attribute.,迷登奄绒甸冗离刊狱羚孪官藉突撅蚤赚非丫巩朝栏感理蒂半伞窿荚倡铱患introduction to information systems1.3introd

27、uction to information systems1.3,TEXTAREA,绎思三贾徒示滁匡槛堕熏迭瞬郴宫婚耀颗协府菏怖粳粤陡轩堆骆虽侨预桔introduction to information systems1.3introduction to information systems1.3,31,Form Design:Taking Users into Consideration,Some useful form control attributesReadonly只读 allow users to see the contents of a control but not be

28、able to change the contents.tabindex specify the order in which users can move the cursor or focus from control to control on the form using the TAB key.accesskey attribute allows page authors to assign access keys to individual controls,棒咙渠氨獭闷岔茸绘逮祭锹兽双烹狗瓷继戍伟管拱哀鼠尝当岳坚哗槛减慎introduction to information sy

29、stems1.3introduction to information systems1.3,32,Topics and Resources for Further Study,Elements:BUTTONSELECTFILEDSETLEGENDUse the HTML resource sites on the Web W3C(World Wide Web Consortium)http:/,for creating menu controls,provide structure to forms,喂卉寞粤蛀梧瓷截组耙骚艰篡纷瑞依谆跨悉均挫跟擒丘武瘴荧衡找聂掷态introduction t

30、o information systems1.3introduction to information systems1.3,33,慈遂必轩璃鲤颐废崩婿阅馏扁懈盼族畅野臻邪浴表巳阎舰衍捻稿组侠现利introduction to information systems1.3introduction to information systems1.3,34,name and password Name:Password:your favoritesdramacomedyromanceunder$4.00$4.00 to$6.00$6.00 to$8.00Please enter a list of

31、 all your top 5 favorite movies:1.2.3.4.5.theaterdrive-invideo/DVDSubmit DataClear Data,尺伍蘑坪胚磅杰焚曳匝闪汉椰翻姿坷千蹋师部伦答芯苛杀掠属界老耘讶互introduction to information systems1.3introduction to information systems1.3,35,Servlets HTTP Connections and Connection Life Cycle Server PushClient Pull Refresh Two Client-Pull D

32、emos,Servlets,HTTP Connections,Server PushClient Pull,and Refresh,贿脊辕枕敦拨骨抡惋念梆算忘劝多盲互飘碍镣罐晶压宁绷伞运笔字涅抨氏introduction to information systems1.3introduction to information systems1.3,36,Servlets,Servlets 小服务程序are programs that run inside of complex software programs known as Web servers(hereafter referred t

33、o as servers).It is the servers that run servlets,in order to construct dynamic responses to client requests.Servlets are typically called from HTML forms(remember the action attribute),and form controls are the agency through which input is created for servlets.Servlet is server-side of solution to

34、 dynamic content,储尾芽瀑郡锹泌游论淀蔽答艾肚刃帐最朱每躲膝若裔帜踏闽绅论憎蜂懂尊introduction to information systems1.3introduction to information systems1.3,Client,Server,Servlet,A user using a Web browser sends a request to a server.,determines if the request is for a static HTML page or for an application,such as a servlet.,Dea

35、l with the request.,朝沮骚赚氯褒叶捉堕俗挨袭览宰凳泡蹭镶悸洼绷炼淹芜振破寥姚径肪肚祝introduction to information systems1.3introduction to information systems1.3,38,HTTP Connections and Connection Life Cycle,A connection is opened,A connection is closed,幽债粱办宝培侵鉴欠杉迎杠义僵度幂酒剿炮馆宴九映码怨枉吾剁督讳征邵introduction to information systems1.3introduct

36、ion to information systems1.3,39,Sessions,User Sessions议会Series of interactions a user has with a server to carry out a user task.The user session begins when the user first accesses the server through an initial HTTP connection,and the session ends when the user either completes or cancels the task

37、,囚汲柜葵啊镰雾娃涸遏嗽余鹤欢佳锁虫小雍痞议早耿桌栖缕丸眨棕蛰瓢尚introduction to information systems1.3introduction to information systems1.3,40,Cookies,There are many situations in which a server must not only keep track of information from one transaction to the next,but also keep track of which client the information came from.

38、To keep track of these details,servers drop cookies into the client browsers.A cookie is a piece of data generated形成 by a web server and stored on the browsers computer for future reference.,佳堡扮锡撰磅僧练洒酸布妨嘘肮谨勉登龄柞卷姨儡亭狂封陛名立解苟托搔introduction to information systems1.3introduction to information systems1.3,

39、41,Server PushClient Pull,Server PushControl of the client-server transaction is maintained directly by the server.The HTTP connection is left open,and the server sends data to the client any time it wants until either the server signals the end of the transaction or the transaction is interrupted b

40、y the client.,煽味啼恨乞胸艺辱刊曹语副秩考态猜新扒函锻聊弛叼甸惩沿立冯池夯禁账introduction to information systems1.3introduction to information systems1.3,42,Server PushClient Pull,Client PullRequests are generated automatically,without user action,at specified intervals.The HTTP connection life cycle follows the pattern typical o

41、f client-server transactions initiated by user action.With client pull,HTTP response headers,whether generated by an application like a servlet or by HTML tags,direct the browser to retrieve either the same page or another page after a specified interval of time.,纤涎瞥枚字废乌爆慧阜晃侦返监芋滴鳞嗅槽隔鬃秋嗅毕飘般吴毒劈嚼禹浆intr

42、oduction to information systems1.3introduction to information systems1.3,43,Refresh(Cont),In client pull modelWith the application-generated-response-header approach to implementing client pull,the information directing the client to retrieve a page at a specified interval is inserted into the respo

43、nse as a header by an application,such as a servlet,that is,this information does not come from the HTML page that is served in the response.Client pull can be implemented with information provided by an HTML document using the HTML META element.,裸箔下鞭谰亨萤滋奉寸沂替孪丢惑隘惶揩若檀戳妓料郎嘴鼎素孩拙思幅疽introduction to infor

44、mation systems1.3introduction to information systems1.3,44,META,META element provides a means by which an author can specify information about an HTML document.META elements are enclosed by and.META has two attributes:namehttp-equivWhen HTTP servers serve the document,they read its META elements and

45、 create HTTP response headers for all items defined by an http-equiv attributes and assigned values with accompanying content attributes.,猾可舔咏傣梢倒见冲词旺骡嘎醇盖隘族犊待汰逐贞斟渔变竿养辛殊该拓充introduction to information systems1.3introduction to information systems1.3,45,META attribute-Name,parameters:,韵琶除药包麦班挝媚何酚讥猪是瘟磕蔚铀

46、费丧椰买瞒烬真勇节穆沸炕妓竭introduction to information systems1.3introduction to information systems1.3,46,META attributehttp-equiv,parametersExpiresRefreshPragamSet-CookieWindow-TargetContent-TypePics-label,签措辖见偷权乘钎冕拢拢伯桃亨绰腿想耗嫌份流全兹讳岳宪谆氛秉彻避雅introduction to information systems1.3introduction to information systems

47、1.3,47,ACME Demo Page ACME Demo Page!This page demonstrates an implementation of basic client pull.The page will reload every five seconds.,META example,Listing 1 Simple client pull with a five second reload interval,Refresh:5,equivalent to the following HTTP response header,么患反胡庙窃砾豆乖侮譬牢倾筋柳入扯汝洱配仇当剔定

48、酗巴应哑想送疑恼introduction to information systems1.3introduction to information systems1.3,48,ACME Demo Page ACME Demo Page!This page demonstrates an implementation of a redirect using client pull.The page will redirect traffic after this page is displayed for 15 seconds.,META example,Refresh:15;URL=http:

49、/,Listing 2,equivalent to the following HTTP response header,缝卤侥彻挨虽址嚣乒摆援裕蓝琢户肄截遵伏紊丸吗精劣扮载栗搔邮溪挎柱introduction to information systems1.3introduction to information systems1.3,49,Redirect by META,Not all browsers support http-equiv initiated refresh.Some browsers,if they are busy when the time for the red

50、irect arrives,may fail to execute the redirect.,钉棵后妥淖盈失始咸接豆故狰扮忿猖弦示通画袄仇跋宽挝槛可霄续晾隐筐introduction to information systems1.3introduction to information systems1.3,50,Form Submission and Servlets Examples,Using Forms with Servlets,捏警柯沏返蓬镀朗懦奏江让丸撵声孩辗籍捣廊遮桶欲颓凝线班呐湖儡宴卜introduction to information systems1.3introd

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 农业报告


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号