川大《Web技术》第二次网上作业及答案
WEB技术(新) 阶段作业二

一、单项选择题(共10道小题,共100.0分)1. 在开发Java Web应用程序的时候,HTTP请求消息使用GET或POET方法以便在WEB上传输数据,下列关于GET和POST 方法描述正确的是()A. POST请求的数据在地址栏不可见B. GET请求提交的数据在理论上没有长度限制C. POST请求对发送的数据的长度限制在240——255个字符D. GET请求提交数据更加安全2. 在Java Web开发中,如果某个数据需要跨多个请求存在,则数据应该存储在哪个对象中()A. sessionB. pageC. requestD. response3. 下列关于JSP动作元素说法中错误的是()A. <jsp:plugin>元素用于把另外一个资源的输出内容插入进当前JSP页面的输出内容之中B. 当Jsp文件被编译,送往浏览器时,<jsp:plugin>元素将会根据浏览器的版本替换成<object>或者<embed>元素C. <jsp:param>操作被用来以"名-值"对的形式为其它标签提供附加信息D. <jsp:fallback>是<jsp:plugin>动作的一部分,并且只能在<jsp:plugin>动作中使用4. 下列关于JSP编译指令说法错误的是()A. 编译指令用于从JSP发送一个信息到Servlet容器上B. 编译指令元素为编译阶段提供了全局信息C. 编译指令向客户端产生任何输出D. 编译指令所有的指令都在整个JSP页面内有效5. 在HTML页面中包含如下所示代码,则编写Javascript函数判断是否按下键盘上的回车键正确的编码是()<input name="password" type="text" onkeydown="myKeyDown()">A. function myKeyDown(){ if (window.keyCode==13) alert("你按下了回车键");}B. function myKeyDown(){ if (document.keyCode==13) alert("你按下了回车键");}C. function myKeyDown(){ if (event.keyCode==13) alert("你按下了回车键");}D. function myKeyDown(){ if (keyCode==13) alert("你按下了回车键");}6. 在HTML页面中包含一个按钮控件mybutton,如果要实现点击该按钮时调用已定义的JavaScript函数compute,要编写的HTML代码是()A. <input name="mybutton" type="button" onBlur="compute()"value="计算">B. <input name="mybutton" type="button" onFocus="compute()"value="计算">C. <input name="mybutton" type="button" onClick="function compute()"value="计算">D. <input name="mybutton" type="button" onClick="compute()"value="计算"7. 某网页中有一个表单,其名称是mainForm,该表单的第一个元素是按钮,其名称是myButton,则表述该按钮对象的方法是()A. document.forms.myButtonB. document.mainForm.myButtonC. document.forms[0].element[0]D. document. myButton8. JavaScript产生当前日期的方法是()A. Now()B. Date()C. new Date()D. new Now()9. 下列JavaScript的判断语句中正确的是()A. if(i==0)B. if(i=0)C. if i==0 thenD. if i=0 then10. 如果想在网页显示后动态地改变网页的标题()A. 是不可能的B. 使用JavaScript语句,document.write("新的标题内容");C. 使用JavaScript语句,document.title=("新的标题内容");D. 使用JavaScript语句,document.changeTitle("新的标题内容");。
《WebServices技术》模拟试题2及答案

《WebServices技术》模拟试题2及答案一填空题(每空2分,合计20分)1.Microsoft把Web服务视为是编程模型的基石。
答案:.NET解释:Microsoft关于Web服务的定义为:Web服务是一个向其他应用提供数据和服务的应用逻辑单元。
应用程序通过无处不在的Web协议和数据格式访问Web服务,如HTTP、XML和SOAP,而无须关系每个Web服务是如何实现的。
Web服务把基于构建开发的长处与Web相结合,并且是.NET编程模型的基石。
2.<在XML中表示。
答案:<解释:在XML中,<>&'"分别表示<、>、&、‘、“。
3.元素内容模型有三种:只含子元素,和空元素。
答案:混合元素解释:XML中元素的规定,元素内容模型有三种:只含子元素,混合元素和空元素。
4.DTD中使用代表任意个,零个或多个。
答案:*解释:DTD规定了XML文档的有效性,其中*代表任意个,零个或多个。
5.在XML模式中,一个子元素的出现次数没有限定,则属性maxOccurs 的值应为。
答案:unbounded解释:子元素的最大出现次数使用maxOccurs限定,如果不限定,则其值为unbounded。
6.SOAP的中文全称是。
答案:简单对象访问协议解释:SOAP是Simple Object Access Protocol简单对象访问协议的缩写。
7.SOAP封套的属性被用来指定编码规则及其作用范围。
答案:encodingStyle解释:通过SOAP封套的encodingStyle(编码形式)属性来指定编码规则及其作用范围。
它定义为全局属性,可以出现在任何元素中。
同一个SOAP 消息中,可混合使用不同的编码形式。
8.在WSDL文档中,元素描述了Web服务的接口。
答案:portType解释:在WSDL中,抽象接口portType描述了终端的处理能力(干什么),可以支持任何数量的操作operation,操作由一组消息message定义,表达了操作的交互方式。
Review_for_Chapter_2,川大计网部分习题答案第二章

Chapter 2 Review QeustionsR1,R3,R4,R5,R10,R11,R13,R15,R16,R20,R21,R22,R27,R28R1. List five nonproprietary Internet applications and the application-layer protocols that they use.Answer:The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP;e-mail: SMTP.R3. What is the difference between network architecture and application architecture?Answer:Network architecture refers to the organization of the communication process into layers (e.g., the five-layer Internet architecture). Application architecture, on the other hand, is designed by an application developer and dictates the broad structure of the application (e.g., client-server or P2P)•R4What information is used by a process running on one host to identify a process running on another host?Answer:The IP address of the destination host and the port number of the destination socket.•R5For a P2P file-sharing application, do you agree with the statement, “There is no notion of client and server sides of a communication session”? Why or why not?Answer:No. As stated in the text, all communication sessions have a client side and a server side. In a P2P file-sharing application, the peer that is receiving a file is typically the client and the peer that is sending the file is typically the server.•R10Recall that TCP can be enhanced with SSL to provide process-to-process security services, including encryption. Does SSL operate at the transport layer or the application layer? If the application developer wants TCP to be enhanced with SSL, what does the developer have to do ?Answer:SSL operates at the application layer. The SSL socket takes unencrypted data from the application layer, encrypts it and then passes it to the TCP socket. If the application developer wants TCP to be enhanced with SSL, she has to include the SSL code in the application.•R11What is meant by a handshaking protocol?Answer:A protocol uses handshaking if the two communicating entities first exchange control packets before sending data to each other. SMTP uses handshaking at the application layer whereas HTTP does not.•R13Telnet into a Web server and send a multiline request message. Include in the request message the If-modified-since: header line to force a response message with the 304 Not Modified status code.Answer:Issued the following command (in Windows command prompt) followed by the HTTP GET message to the “”web server:> telnet 80Since the index.html page in this web server was not modified since Fri, 18 May 2007 09:23:34 GMT, the following output was displayed when the above commands were issued on Sat, 19 May 2007. Note that the first 4 lines are the GET message and header lines input by the user and the next 4 lines (starting from HTTP/1.1 304 Not Modified) is the response from the web server.•R15Suppose Alice, with a Web-based e-mail account (such as Hotmail or gmail), sends a message to Bob, who accesses his mail from his mail server using POP3. Discuss how the message gets from Alice’s host to Bob’s host. Be sure to list the series of application-layer protocols that are used to move the message between the two hosts.Answer:Message is sent from Alice’s host to her mail server over HTTP. Alice’s mail server then sends the message to Bob’s mail server over SMTP. Bob then transfers the message from his mail server to his host over POP3.•R16Print out the header of an e-mail message you have recently received. How many Received: header lines are there? Analyze each of the header lines in the message.Answer: skipped•R20Consider a new peer Alice who joins BitTorrent without possessing any chunks. Without any chunks, she cannot become a top-four uploader for any of the other peers, since she has nothing to upload. How then will Alice get her first chunk?Answer:Alice will get her first chunk as a result of she being selected by one of her neighbors as a result of an “optimistic unchoke,”for sending out chunks to her.•R21In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval. Will Bob necessarily return the favor and provide chunks to Alice in this same interval? Why or why not?Answer:It is not necessary that Bob will also provide chunks to Alice. Alice has to be in the top 4 neighbors of Bob for Bob to send out chunks to her; this might not occur even if Alice is provides chunks to Bob throughout a 30-second interval.•R22What is an overlay network? Does it include routers? What are the edges in the overlay network? How is the query-flooding overlay network created and maintained?Answer:The overlay network in a P2P file sharing systemconsists of the nodes participating in the file sharingsystem and the logical links between the nodes. There is a logical link (an “edge”in graph theory terms) from node A to node B if there is a semi-permanent TCPconnection between A and B. An overlay network does not include routers. With Gnutella, when a node wants to join the Gnutella network, it first discovers the IPaddress of one or more nodes already in the network. It then sends join messages to these nodes. When the node receives confirmations, it becomes a member of the of Gnutella network. Nodes maintain their logical links with periodic refresh messages.•R27For the client-server application over TCP described in section 2.7, why must the server program be executed before the client program? For the client-server application over UDP described in Section 2.8, why may the client program be executed before the server program?Answer:For the TCP application, as soon as the client is executed, it attempts to initiate a TCP connection with the server. If the TCP server is not running, then the client will fail to make a connection. For the UDP application, the client does not initiate connections (or attempt to communicate with the UDP server) immediately upon execution•R28The UDP server described in Section 2.8 needed only one socket, where the TCP server described in Section 2.7 needed two sockets. Why? If the TCP server were to support n simultaneous connections, each from a different client host, how many sockets would the TCP server need?Answer:With the UDP server, there is no welcoming socket, and all data from different clients enters the server through this one socket. With the TCP server, there is awelcoming socket, and each time a client initiates aconnection to the server, a new socket is created. Thus, to support n simultaneous connections, the serverwould need n+1 sockets.ProblemsP1,P4,P5,P7,P8,P16,P24,P25•P1True or false?a. A user requests a Web page that consists of some textand three images. For this page, the client will sendone request message and receive four responsemessages.b.Two distinct Web pages (for example,/research.html and/student.html)can be sent over the same persistent connection.c.With nonpersistent connection between browser andorigin server, it is possible for a single TCP segment to carry two distinct HTTP request messages.d.The Date: header in the HTTP response messageindicates when the object in the response was lastmodified.Answer:a) Fb) Tc) Fd) F•P4Obtain the HTTP/1.1 specification (RFC2616). Answer the following questions: a.Explain the mechanism used forsignaling between the client and serverto indicate that a persistent connection is being closed. Can the client, theserver ,or both signal the close of aconnection?b.What encryption services are providedby HTTP?Answer:a) Persistent connections are discussed in section 8 ofRFC 2616 (the real goal of this question was to getyou to retrieve and read an RFC). Sections 8.1.2 and8.1.2.1 of the RFC indicate that either the client or theserver can indicate to the other that it is going to close the persistent connection. It does so by including theincluding the connection-token "close" in theConnection-header field of the http request/reply.b) HTTP does not provide any encryption services.•P5Read RFC 959 for FTP. List all of theclient commands that are supported by the RFC.Answer:Access control commands:USER, PASS, ACT, CWD, CDUP, SMNT, REIN, QUIT.Transfer parameter commands:PORT, PASV, TYPE STRU, MODE.Service commands:RETR, STOR, STOU, APPE, ALLO, REST, RNFR, RNTO, ABOR, DELE,RMD, MRD, PWD, LIST, NLST, SITE, SYST, STAT, HELP, NOOP.•P7Suppose within your Web browser you click on a link to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS lookup is necessary to obtain the IP address. Suppose that nDNS servers are visited before your host receives theIP address from DNS; the successive visits incur andRTTof RTT1,…RTTn. Further suppose that the Webpage associated with the link contains exactly one object, consisting of a small amount of HTML text. LetRTT0denote the RTT between the local host and theserver containing the object. Assuming zero transmission time of the object, how much time elapses from when the client clicks on the link until the client receives the object?Answer:The total amount of time to get the IPaddress iselapses to set up the Once the IP address is known, RTTTCP connection and another RTTelapses to requestand receive the small object. The total response time is•P8Referring to Problem P7,suppose theHTML file references three very smallobjects on the same server. Neglecting transmission times, how much timeelapses witha.Non-persistent HTTP with no parallelTCP connections?b.Non-persistent HTTP with parallelconnections?c.Persistent HTTP?Answer: a)b)c)•P16Consider distributing a file of F=5 Gbits to N peers. The server has an upload rateof us =20Mbps, and each peer has adownload rate of di =1Mbps and anupload rate of u. For N=10,100, and1,000 and u=100Kbps, 250Kbps,and 500Kbps,prepare a chart giving the minimum distribution time for each of the combinations of N and u for both client-server distribution and P2P distribution.Answer:For calculating the minimum distribution time for client-server distribution, we use the following formula:Similarly, for calculating the minimum distribution time for P2P distribution, we use the following formula:•P24Suppose that in UDPClient.java we replace the LineDatagramSocket clientSocket= new DatagramSocket();withDatagramSocket clientSocket= new DatagramSocket(5432);Will it become necessary to changeUDPServer.java? What are the port numbers for the sockets in UDPClient and UDPServer?What were they before making this change?Answer:•P25Install and compile the Java ProgramsTCPClient and UDPCLient on one hostand TCPServer and UDPServer onanother host.a.Suppose you run TCPClient before yourun TCPServer. What happens? Why?b.Suppose you run UDPCLient before yourun UDPServer. What happens? Why?c.What happens if you use different portnumbers for the client and server sides?Answer:a)If you run TCPClient first, then the client will attempt to make a TCP connection with a non-existent server process.A TCP connection will not be made.b) UDPClient doesn't establish a TCP connection with the server. Thus, everythingshould work fine if you first run UDPClient, then run UDPServer, and then type some input into the keyboard.c) If you use different port numbers, then the client will attempt to establish a TCP connection with the wrong process or a non-existent process. Errors will occur.。
动态网制作(本科)第二次作业_0001-四川电大-课程号:5107703-[参考答案]
![动态网制作(本科)第二次作业_0001-四川电大-课程号:5107703-[参考答案]](https://img.taocdn.com/s3/m/257d6b3d79563c1ec5da71fb.png)
动态网页制作(开放本科)第二次作业_0001
四川形成性测评系统课程代码:5107703 课程复习资料
、单项选择题(共 20 道试题,共 80 分。
)
1. 请问Mid(“I am a student.”,9,2)的返回值是什么?()
A. "tu"
B. "st"
C. "en"
D. "nt"
正确的答案是:A
2. 在VBScript中,下列说法正确的是()。
A. 没有计算数的指数次方的运算符,但可以通过* 运算符实现。
B. &运算符可以强制将任意两个表达式进行字符串链接。
C. 表达式 16/5 的结果是1。
D. 以上都正确
正确的答案是:B
3. 在VBScript中,下列运算符优先级最高的是()。
.
A. 求余运算 (Mod)
B. 负数 (-)
C. 乘法和除法 (*, /)
D. 字符串连接 (&)
正确的答案是:B
4. 执行完 a=5 Mod 3 语句后,a的值为()。
A. 0
B. 2
C. 3
D. 5
正确的答案是:B
5. 下面 a=Trim(" vbscript") & Rtrim(" good") 语句后,a的值为()。
A. " vbscript good"
B. "vbscript good"。
川大《WEB技术》18春在线作业2-0001参考答案

试卷总分:100得分:0
一、单选题(共21道试题,共84分)
1.下面不可以用来处理图形的软件是:
A.Fireworks
B.Flash
C.FrontPage
D.Photoshop
正确答案:C
2.以下不属于动态网页技术的是:
A.CGI
C.HTML
正确答案:C
18.常用的网页图像格式有:
A.gif,tiff
B.tiff,jpg
C.gif,jpg
D.tiff,png
正确答案:C
19.下列()表示的不是按钮。
A.type="submit"
B.type="reset"
C.type="image"
D.type="button"
正确答案:C
20.属于静态网页文件扩展名的是:
另一方面,随着社会的发展,人们的就业观念发生了重大变化,更多的人认为工作的目的不仅仅是为了生存,而是为了实现自身的价值,人们不再愿意从事那种传统的束缚于单位的就业形式,而更愿意寻找一种适合自己意愿的、满足自己爱好的、更加自由的就业方式,从而拥有更多属于自己的自由时间和空间来安排自己的生活、实现个人的价值,近年来兴起的SOHO一族就是典型例证。SOHO是Small Office Home Office(小办公室、居家办公室)的缩写,它是指个人以自己的家或小型场所为办公室而从事工作的小型事业体(个体户)。SOHO代表了一种自由的新型就业方式,其工作场所不固定,工作时间自由,收入高低也不确定,特别适合与高新科技、信息技术相关工作的劳动者,如软件程序员、网络工程师、记者、编辑、自由撰稿人、音乐制作人、广告工作者、咨询师等。
《WEB技术》20春在线作业2-0001【四川大学答案49980】

21.一个网站是通过()将很多的网页链接在一起的。 A.文字 B.超媒体 C.超链接 D.图像
多选题 1.在表格元素中,TR元素的VALIGN属性的可能值有 A.TOP B.MIDDLE C.CENTER D.BOTTOM E.BASELINE
3.以下扩展名中不表示网页文件的是: A..htm B..html C..asp D..txt
4.下列()是定义样式表的正确格式。 A.{body:color=black(body)} B.body:color=black C.body {color:black} D.{body;color:black}
14.可以不用发布就能在本地计算机上浏览的页面编写语言是 A.ASP B.HTML C.PHP D.JSP
15.一台装有windows系统的计算机,要上网必须安装()协议。 Beui B.IPX/SPX C.TCP/IP D.FTP
16.要创建一个到UseNet新闻组的链接,下面正确的句法是 A.蓝色新闻网 B.蓝色新闻网 C.蓝色新闻网
《WEB技术》20春在线作业2-0001 红字部分为答案!
单选题 1.浏览网页,是属于 Internet 所提供的()服务。 A.FTP B.Email C.Telnet D.WWW
2.下面不是网页美化工具的是: A.Dreamweaver B.Fireworks C.Photoshop D.Freehand
2.在BODY的属性中,和颜色相关的有 A.ALINK B.BGCOLOR C.LINK D.TEXT E.VLINK
判断题 1.在IE中,通过“查看”菜单下的“源文件”菜单项可查看到HTML网页的源代码。
计算机二级Web练习题及答案(2)

计算机二级Web练习题及答案(2)
计算机二级Web练习题及答案2017
12以下选项中,全部都是表格标记的是( )。
参考答案:B
简答题:
当前主要的 WEB数据库访问技术有哪些?
答:到目前为止,WEB数据库访问技术主要分为两大类:
(1)公共网关接口技术(CGI);
CGI 是 WEB 服务器运行时外部程序的'规范,按照 CGI 编写的程序可以扩展服务器的功
能,完成服务器不能完成的工作,外部程序执行时可以生成HTML 文档,并将文档返回
WEB服务器。
(2)服务器端脚本编程技术。
当前较为流行的几种有代表性的服务器端脚本编程技术是ASP、PHP、JSP。
HTML是什么?简述它的基本结构。
答:HTML(Hypertext Marked Language,超文本标记语言)是一种用来制作 WEB 上超文
本文档的简单标记语言。
对于大多数WEB页面来说,都具有如下所示的基本结构:
……主体内容……
ASP提供的 6个内置全局对象的名称及其主要功能是什么?
(1)Response(响应)对象:它控制在HTTP响应消息中,将消息发送给浏览器
(2)Request(请求)对象:它在一个HTTP请求过程中,获取由浏览器传送给服务器的消息
(3)Server(服务器)对象:它提供对驻留在服务器上的资源的访问
(4)Session(会话期)对象:它用于存储和管理与一个特定的用户会
话有关的信息
Application(应用程序)对象:它用于存储和管理与该Web 应用程序有关的信息
ObjectContext:用来配合 Microsoft Transction Server进行分散式交易处理。
四川大学《WEB技术》20春在线作业2.doc

1.浏览网页,是属于 Internet 所提供的()服务。
A.FTPB.EmailC.TelnetD.WWW【参考答案】: D2.下面不是网页美化工具的是:A.DreamweaverB.FireworksC.PhotoshopD.Freehand【参考答案】: A3.以下扩展名中不表示网页文件的是:A..htmB..htmlC..aspD..txt【参考答案】: D4.下列()是定义样式表的正确格式。
A.{body:color=black(body}B.body:color=blackC.body {color: black}D.{body;color:black}【参考答案】: A5.HTML定义了网页的结构,()决定了浏览器如何显示HTML代码。
A.JavaScriptB.CSSC.XMLD.C#【参考答案】: B6.用于设置文本框显示宽度的属性是:A.SizeB.MaxLengthC.ValueD.Length【参考答案】: A7.若要以加粗宋体、6号字显示“hello”以下用法中,正确的是:A.bfont size=6hello/b/fontB.bfont face=”宋体”size=6hello/font/b C.bfont size=“宋体”size=6hello/b/font D.bfont size=“宋体”fontsize=6hello/b/font【参考答案】: B8.以下不是被称为“网页设计三剑客”的是:A.DreamweaverB.FrontPageC.FireworksD.Flash【参考答案】: B9.下面不是常用的浏览器软件的是:A.Internet ExplorerB.NavigatorC.MosaicD.Word【参考答案】: D10.要创建一个到FTP的链接,下面正确的句法是:A.A HREF=〃news:166.111.136.3〃清华九井站点/AB.A HREF=〃usenet:166.111.136.3〃清华九井站点/AC.A HREF=〃ftp://166.111.136.3〃清华九井站点/AD.A HREF=〃http://166.111.136.3〃清华九井站点/A【参考答案】: C11.Dreamweaver 是()软件。