Web Fundamentals(web技术概论)

Web Fundamentals
2013级 高飙
• A user input "http://www.pku.edu.cn/" in the Address blank and hit the "enter". Explain in details about the interactions between the Browser and other servers.
1.浏览器通过URL访问DNS,DNS返回一个IP地址;
2.浏览器用IP地址建立TCP/IP链接
3.浏览器通过TCP/IP链接给服务器发送一个HTTP请求
4.根据这个请求,服务器找到合适的文件,生成一个MIME(多功能Internet邮件扩充服务)格式的响应,并将响应传回浏览器,随后关闭连接;
5.根据HTTP响应的head信息,浏览器显示收到的文件
6.注意:每个图片浏览器需要建立一个TCP/IP连接,传送,并关闭连接。

• Carefully review the steps taken to install and configure an Apache on the course server.
安装步骤:
1.解压缩:tar –xzf 文件名
2.mkdir apache
3../configure --prefix=/home/year/username/apache
4.Make ,the building of apache is done.
5.Make install , to put Apache into correct position.
6.修改端口:httpd.conf 的listen XX
7.在apache/htdocs/下 mv index.html.en index.html
8."/home/year/username/apache/bin/apachectl start"

• Explain the following queries enclosed in brackets that are inputed to Google:
1.[to be or not to be] vs ["to be or not to be"]
2.How does Gogle treat multiple key words by default? Is the relation between them AND or OR?
3.[University -"Tsinghua University"]
4.[intitle: "baRAcK oBaMA"]
5.[inanchor: "O'Reilly Media"]
指令返回的结果是导入链接锚文本文字中包含搜索词的页面。比如在Google搜素“inanchor:点击这里”,返回的结果页面本身并不一定包含“点击这里”这四个字,而是指向这些页面的链接文字中出现了“点击这里”这四个字。
6.[site:pku.edu.cn your name]
7.[inurl:HOWTO]
8.[link:net.pku.edu.cn]
list webpages that have links to the specified webpage.
9.[filetype:pdf]
10.[define: web 2.0]
11.[define: AJAX]
12.[XSLT "stands for"]
add "stands +for" to the query if it's an abbreviation or acronym.

•Tim Berners-Lee is named the "father of World Wide Web", who majored in Physics.
Mosaic was the first Web browser with a graphical user Interface.

•All URLs have the same general format: scheme:object-address. You should be able to understand various kinds of URL. Such as URL which executes a CGI program on remote server, URL which points to a port other than 80, URL which points to a local document and URL with a FTP protocol.

scheme告诉浏览器使用哪种通信协议,一般scheme包括http,ftp,telnet,file,mailto and news.
格式为scheme//<user>:<password>@<host>:<port>/<usrl-path>

 


HTTP, HTML Head section and CSS
•MIME stands for Multipurpose Internet Mail Extensions. It helps browser to determine the formats of the document that the browser gets from the Web servers. Generally, a list of MIME specifications in the format of type/subtype is stored in configuration files of each Web server. Web server determines the type of a document by using the filename's extension as the key into a configuration file. The type is transfered by the Content-type field of HTTP response header.

•The following are output by connecting to the HTTP Servers on respective Web Site and send a HTTP GET request: GET / HTTP/1.1. Try to understand those HTTP Respond fields in RED. Make sure you understand the Cache-Control mechanism of HTTP 1.1
1.FROM SOHU
HTTP/1.0 200 OK
Date: Mon, 10 Dec 2007 03:13:07 GMT
Server: Apache/1.3.37 (Unix) mod_gzip/1.3.26.1a
Vary: Accept-Encoding,X-Up-Calling-Line-id,X-Source-ID,X-Up-Bearer-Type,x-huawei-nasip,x-wap-profile
Cache-Control: max-age=70
Expires: Mon, 10 Dec 2007 03:14:17 GMT
Last-Modified: Mon, 10 Dec 2007 03:08:41 GMT
ETag: "321c010-3b034-475cadb9"
Accept-Ranges: bytes
Content-Length: 241716
Content-Type: text/html
Age: 45
X-Cache: HIT from 12100660.21669138.13974729.sohu.com
Via: 1.0 12100660.21669138.13974729.sohu.com:80 (squid/2.6.STABLE13)
Connection: close

<!-- head -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title></title>
<script src="http://www.sohu.com/sohuflash_1.js" type=text/javascript></script>
<style type="text/css">
<!--
td,body,input,select {font-size: 12px;}

</style>
</head>

HTTP1.1应答的几个介绍
Vary: Accept-Encoding:告诉代理服务器缓存两种版本的资源:压缩和非压缩,这有助于避免一些公共代理不能正确地检测Content-Encoding标头的问题。”
Connection:表示是否需要持久连接。如果Servlet看到这里的值为“Keep-Alive”,或者看到请求使用的是HTTP 1.1(HTTP 1.1默认进行持久连接),它就可以利用持久连接的优点,当页面包含多个元素时(例如Applet,图片),显著地减少下载所需要的时间。
Expires 应该在什么时候认为文档已经过期,从而不再缓存它
Last-Modified 文档的最后改动时间。客户可以通过If-Modified-Since请求头提供一个日期,该请求将被视为一个条件GET,只有改动时间迟于指定时间的文档才会返回,否则返回一个304(Not Modified)状态。
Set-Cookie 设置和页面关联的Cookie。
Date 当前的GMT时间。
Content-Type 表示后面的文档属于什么MIME类型。Servlet默认为text/plain
cache-control头文件来通知客户端浏览器的缓存方案,常见的取值有private、no-cache、max-age、must-revalidate等,默认为private。 Max-age=30表示访问此网页后30s不再访问服务器
Age: 当代理服务器用自己缓存的实体去响应请求时,用该头部表明该实体从产生到现在经过多长时间了。
HTML, the Body
•The following tags should be remembered.
Paragraphs,Line Breaks, Headings, Image, Hypertext Links, including one that targets at within the Document, An ordered list and an unordered list. A table with rowspan and colspan Attributes specified, and a HTML comment.

HTML标签(一定有<html><head><title><body>)
<!DOCTYPE HTML SYSTEM>
Paragraphs:<p>balabala</p>
line:<br />
heading:<h1><h1/> 1-6
image:<img src="图片地址" alt="备选文本" />
Hypertext Links:<a href="http://www.example.com/">这是链接</a>
无序列表
<ul>
<li>第一个项目</li>
<li>第二个项目</li>
</ul>
有序列表
<ol>
<li>第一个项目</li>
<li>第二个项目</li>
</ol>
表格:<th> 定义表格表头
<tr> 定义表格里的一行
<td> 定义表格里的一个单元格
<th colspan="2">两列
<th rowspan="2">两行
框架
<frameset rows="22%, *">
<frame noresize="noresize" src="head.html" />
<frameset cols="15%, *">
<frame noresize="noresize" src="contents.html" />
<frame src="main.html" name="main"/>
</frameset>
</frameset>

html comment: <!-- 注释 -->

Ajax
1.Explain what does Ajax stand for. Why we need it?
创建交互式 Web 应用程序而无需牺牲浏览器兼容性的流行方法(Asynchronous JavaScript and XML) 目的是是基于web的应用程序在交互速度方面进而在用户体验方面更接近于客户端的桌面应用程序
传统的web交互中,客户机向服务器发送消息的方式或者是通过单击链接,或者是提交表单。然后用新文档取代整个浏览器的显示画面。对于复杂的文档,从服务器传个客户端,浏览器再显示,需要大量的时间。所以需要Ajax
Ajar主要有两点:1服务器和浏览器异步通信,浏览器不需要等待服务器的消息,可以继续做自己的事2服务器正在提供的通常只显示文档中相对较小的一部分,以节约时间
2.List several(>=2) Sceneries when Ajax should be used.
验证和表单填写,google map的只显示一小块,鼠标悬停弹出信息,域用户的快速交互

CGI and FORMs

1.Understand How the URL is encoded before it is send to Web server when a form is submitted.
浏览器通过NAME/VALUE对传递信息,同时对URL进行重新编码:
+代替空格
“%HH“,十六进制的ASCII值,表示非numberic和非字母数据。
=用于分开name和value对
&用来分开不同的name、value对
2.Can tell the difference between the GET method and the POST method.
1、Get将表单中数据的按照variable=value的形式,添加到action所指向的URL后面;Post是将表单中的数据放在form的数据体中,按照变量和值相对应的方式,传递到action所指向URL,之后script从stdin中得到消息。
2、Get是不安全的,因为在传输过程,数据被放在请求的URL中,而如今现有的很多服务器、代理服务器或者用户代理都会将请求URL记录到日志文件中,然后放在某个地方,这样就可能会有一些隐私的信息被第三方看到。另外,用户也可以在浏览器上直接看到提交的数据,一些系统内部消息将会一同显示在用户面前。Post的所有操作对用户来说都是不可见的。
3、Get传输的数据量小,这主要是因为受URL长度限制;而Post可以传输大量的数据,所以在上传文件只能使用Post
4、Get限制Form表单的数据集的值必须为ASCII字符;而Post支持整个ISO10646字符集。默认是用ISO-8859-1编码
5、Get是Form的默认方法。

3.Understand the slight difference between the executing mechanism of a CGI program and that of a PHP program. Why CGI programs are of higher cost comparing to PHP programs?
首先CGI是外部应用程序与Web服务器之间的接口标准,不同类型语言写的程序只要符合cgi标准,就能作为一个cgi程序与web服务器交互,早期的cgi大多都是c或c++。
php可以作为一个cgi使用,作为cgi时,它将作为独立的进程运行,有请求过来就创建一个进程进行响应。当php作为apache的一个模块时,php将作为apache的一个子进程存在,接受apache调用。这样比使用CGI要更高效。

对于CGI,服务器需要创建更多的地址空间同时需要fork进程,PHP的执行已经嵌入到服务器中

Java
1.What is Java? Can tell some features of Java
Java,是由Sun公司于1995年5月推出的Java程序设计语言和Java平台的总称。
特点:简单,面向对象,分布式,健壮,解释型,多线程,动态
2.Can write some Java codes without the help of IDEs such as Eclipse and run them.
public class Hello {
public static void main(String args []) {
System.out.println("Hello World!");
}
}
3.Know differences between applets and servlets, and some knowledge about running them.
applet和servlet
最简单版本
applet是客户端的程序,它们可以直接嵌入到网页或者其他特定的容器中,并能够产生特殊的效果。
servlet是服务端器的程序,用于实现服务器功能的扩充,响应客户端请求
相似之处:
  * 它们不是独立的应用程序,没有main()方法。
  * 它们不是由用户或程序员调用,而是由另外一个应用程序(容器)调用。
  * 它们都有一个生存周期,包含init()和destroy()方法。
  不同之处:
  * Applet具有很好的图形界面(AWT),与浏览器一起,在客户端运行。
  * Servlet 则没有图形界面,运行在服务器端。

含有Applet的网页的HTML文件代码中部带有<applet> 和</applet>这样一对标记,当支持Java的网络浏览器遇到这对标记时,就将下载相应的小应用程序代码并在本地计算机上执行该Applet。 Java Applet 是用Java 语言编写的一些小应用程序,这些程序是直接嵌入到页面中,由支持Java的浏览器(IE 或 Nescape)解释执行能够产生特殊效果的程序。由于Applet是在用户的计算机上执行的,所以它的执行速度不受网络带宽或者Modem存取速度的限制。
样例
import java.applet.Applet;
import java.awt.Graphics;

public class HelloWorld extends Applet {
public void paint(Graphics g) {
g.drawString("Hello world!", 50, 25);
}
}
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="HelloWorld.class" WIDTH=300 HEIGHT=100>
</APPLET>
</BODY>
</HTML>

Servlet是一种服务器端的Java应用程序,具有独立于平台和协议的特性,可以生成动态的Web页面。 它担当客户请求(Web浏览器或其他HTTP客户程序)与服务器响应(HTTP服务器上的数据库或应用程序)的中间层。 Servlet是位于Web 服务器内部的服务器端的Java应用程序,与传统的从命令行启动的Java应用程序不同,Servlet由Web服务器进行加载,该Web服务器必须包含支持Servlet的Java虚拟机。
运行servlet步骤:
1环境配置 2编译servlet程序 3配置web.xml 4把编译好的class放入指定目录运行
HelloJsp.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloJsp extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Hello Jsp!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Hello Jsp!</h1>");
out.println("</body>");
out.println("</html>");
}
}
按上数步骤,最后在浏览器中输入: http://localhost:8080/servlet/HelloJsp
如果出现Hello Jsp!的字样就ok了!

JavaScript
1.You should be able to list the cons or pros of Javascript
pros
浏览器内嵌了JavaScript的解释器,不需要任何插件
JavaScript可以在不需要大量下载的情况下实现动态网页。如applets
良好的安全性,Javascript不能读写本地硬盘
提供object到DOM的直接路径
cons
很难让一个JavaScript在所有浏览器上同样配置,这会使得页面失去可读性
用户可能关闭JavaScript支持
脚本可能跑得很慢。。。

2.Be able to understand Javascript program and modify as required
(1) Control: It uses selection (if, if‐else and switch) and iteration (for and while).
控制:使用分支(if,if-else 和switch)和迭代(for和while)
(2) Variables: Variables are dynamically typed (c.f. perl). You do not have to specify
the data type of a variable when you declare it.
变量,变量是动态类型,类似perl。不需要在声明时确定变量类型
(3) Arrays: Used to store collections of variables (or references). The first element
is at 0. Do not have a fixed length. New versions of JavaScript can use push, pop, shift
and unshift (c.f. perl) BEWARE of browser versions!!
数组:用来储存连续的变量,第一个元素是0,没有确定的长度。新元素可以使用push, pop, shift, unshift. 使用时注意浏览器的版本
(4) Functions: Functions are normally declared in the HTML head and invoked
(called) as required. They can take a variable number of parameters ‐ the actual
number of parameters is found using the DOM field arguments.length. Functions can
have a (single) return value.
方法:方法通常声明在HTML头并且在必要时被调用。他们可以接受一定数量的参数,参数的数量可以在DOM的arguments。length中找到,函数可以有一个返回值。
(5) Objects: JavaScript is object‐oriented ‐ but it's objects are a bit unusual. There
are, as you have seen above with the DOM, some built‐in objects (navigator, document
etc) Predetermined methods (e.g. write()) and fields (e.g. value) of these objects can be
used.
对象:JavaScript是面向对象的,但是有一点不同,对象可以使用一些预先给定的方法和值。

3.Can answer question like: What is javascript sniffer?
JavaScript Browser Sniffer is a browser identifier written in JavaScript (EcmaScript) and
released under the LGPL license. It will tell which browser, version and operating
system you (the visitor) are using. It also detects bots and the Flash plugin. JavaScript
browser sniffers are widely used because of the incompatibilities between browsers.
Different browsers have different ways understanding the same code written by
Javascript. As a result, different browsers will display the same page differently.
Javascript browser sniffers detect what web browser a user is working with so as to
ensure consistent display of content.
JavaScript探测器是一个由javascript编写的在LGPL证书下释放的浏览器标识符。他将描述你使用哪种版本的浏览器和操作系统。他同样会检查FLASH plugin。js探测器被广泛使用是因为浏览器间的不兼容性。不同的浏览器有不同的解码方式。所以不同浏览器会将同一个页面显示成不同结果。所以需要探测器来发现浏览器的类型一遍显示正确的结果

4.How Client-side Javascript is executed?
如果一个XHTML 文档中没有包含任何嵌入式脚本,那么浏览器将逐行读取这个文档,并将其发现的标记、属性和内容呈现在窗口中。如果文档中包含了JavaScript脚本,那么当浏览器遇到这些脚本时,将利用JavaScript 解释器来“执行”脚本。当到达脚本的末尾时,浏览器从解释其中返回,再次开始读取XHTML 文档,并显示其中的内容。
<script type=”type/javascript” src=”…”></script>
<script type=”type/javascript”>
<!‐‐

//‐‐>
</script>

5.JavaScript is Event driven
◦What does this mean?
事件是某些特殊情况发生时的通知,是一个由浏览器和JavaScript 系统为了响应某些正在发生的情况而隐式创建的对象。事件处理程序是一个脚本,它是隐式执行的,以响应发生的相应时间。通常鼠标或热键的动作我们称之为事件(Event),而由鼠标或热键引发的一连串程序的动作,称之为事件驱动(Event Driver)。而对事件进行处理程序或函数,我们称之为事件处理程序(Event Handler)。将事件处理程序链接到事件的过程成为注册。

◦Name 3 specific events that can be handled by JavaScript
blur, change, click, dbclike, focus, keydown, keypress, keyup, load, mousedown, mousemove, mouseout, mouseover,mouseup, reset, select, submit, unload

5.For event handler or for form submitting, know how to choose a ending "return true" or "return false"
如果某个事件处理程序返回值为 false,那么其含义为通知浏览器不要执行该事件的任何默认操作。
6.How do JavaScript objects differ from "traditional" software objects such as Java objects?
JavaScript 不是一种面向对象的语言,它是一种基于对象的语言。JavaScript 没有包含类,它的对象既可以作为对象,又可以作为对象模型,无法支持基于类的继承,也无法支持多态性。
8.Try to understand what does the following page do?
<html>
<head>
<title>What do I do??</title>
</head>
<script type="text/javascript">
function auto(url){
window.location=url;
}
function run(){
var txt;
txt="<img src=\"http://162.105.146.69/favicon.ico?no="+Math.random()+" \"width=\"0\" height=\"0\""+" οnlοad=\"auto('http://162.105.5.253/index.html')\">";
document.write(txt);
}
</script>
<body>
<script type="text/javascript">
run();
</script>
</body>
</html>
◦It tries to load an invisible figure. After the figure is downloaded, it forwards the browser to another html page by triggering the onload event.
◦The ?no=Math.random is used to make the Browser thinking that it is getting different picture each time.
页面尝试下载一个不可见的图片,当图片下载后,他自动转到onload指示的链接。


9.Which property(appName, appVersion) of which object(navigator) indicate the browser name and the version of the browser?

10.Why should document.write not be used in an event handler? Reading reference
文档是随着浏览器对XHTML 代码的解析而逐渐显示的。通常情况下,事件是在整
个文档显示之后才发生的。如果write 方法出现在一个事件处理程序中,由此产生
的内容可能将出现在已显示文档的顶部位置。

11.Javascript supports object-oriented, imperative, and functional programming styles. Please understand these style.

XML
1.List more than three ideal application sceneries when XML should be used.
(1) 数据交换与信息共享
数据交换与信息共享是XML的最重要的用途之一.XML使得不同计算机应用系统之间交换数据变得容易起来 ,这是因为它的可扩展特性和文档中的元数据 .特别地,XML 在下列领域有重要应用:EDI,Agent,软件设计元素的交换,CRM.
(2) Web 应用
XML 文档无疑将成为Web 资源的重要组成部分,而且基于XML 的文档资源使Web搜索引擎的智能化变得容易起来.除此之外,XML 能够用来建立HTML 所不能达到的多层Web 应用,特别地,XML 在Web 应用中有下列用途:集成不同数据源,本地计算,数据的多种显示,支持Web 应用的互操作和集成,基于语义的Data Mining.
(3)文件结构组织
尤其是属性文件结构的组织,XML有很大的优势

2.Know how to format XML by using XSTL.
<?xml version = "1.0"?>
<!-- test.xsl -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/">
<html>
<body>
<h1>My catalog</h1>
<table border="2">
<tr><th>Title</th><th>Author</th><th>Publication details</th><th>ISBN</th></tr>
<xsl:for-each select="catalog/book">
<tr>
<td><span style = "font_style:italic">
<xsl:value-of select="title"/></span></td>
<td><xsl:value-of select="author_forenames"/>
<xsl:value-of select="author_surname"/></td>
<td><xsl:value-of select="year"/>,
<xsl:value-of select="publisher"/>,
<xsl:value-of select="location/city"/>,
<xsl:value-of select="location/country"/></td>
<td><xsl:value-of select="isbn"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

3.Understand the grammars of namespaces, DTDs and schemas.
Namespaces are used to refer to the markup vocabulary that can be used in a document.

<xs:schema
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
targetNamespace = "http://www.cems.uwe.ac.uk/~jtwebb/bookSchema"
xmlns = "http://www.cems.uwe.ac.uk/~jtwebb/bookSchema"
elementFormDefault = "qualified">

This defines:

xs as the prefix for the XMLSchema namespace which contains the names used in defining the schema itself
the target namespace URI - note how the URI is formed from the author's web site address (obviously you should use your own address)
the default (anonymous) namespace
the elementFormDefault = "qualified" forces all lower-level elements etc. to be included in the namespace

 


PHP and Database
PHP
1.Why PHP array is flexible? By the following figure
在PHP 内部,数组的元素被存储在以链表组织的单元里,每个单元存储了元素的
键和值,存储在存储器中的单元位置通过键的散列函数来确定。使用字符串键访
问元素需要通过散列函数完成。但是,元素都含有链表指针,这些指针把它们按
照创建的顺序连接起来,使得在键为字符串时可以按照该顺序来访问它们,如果
键为数值,则按照键的数值顺序来访问。
2.Should be able to understand a small program in PHP.
3.How does Web Server determine whether a requested document includes PHP code?
服务器是通过文档文件的扩展名来判断该文档是否包含 PHP 脚本,如果扩展名为.php、.php3 或.phtml,就说明它嵌入了PHP。

4.How can a variable used outside a function be accessed by the function?
global static

5.How can a variable value be shared in different HTTP pages?
COOKIE and SESSION
Setcookie(string variable name, value);
在一个请求中到达的所有 cookie 放置在$_COOKIES 这个隐函数组中,该数组用
cookie 的名字作为元素的键,cookie 的值作为元素的值。
session_start( ):PHP程序用session_start()创造一个session,如果这个session已经创建,则session_Start()将所有变量加入程序
session_register(string variable name): 将一个变量存入session()
会话的键/值对通过对$_SESSION 数组赋值来创建或修改。

6.How can the value of a form element be accessed by a PHP script?
无论form使用GET还是POST方法,PHP为任任意一个元素建立一个同名变量。这个变量可以直接被PHP使用。他叫做外部变量。
推荐的方法是使用隐含的数组,$_POST 和$_GET,来存储表单值。这些数组的键与表单元素名称匹配,值和客户输入的值匹配。

Database
• Understand and remember the so-called Three- tier web structure.

三层体系结构:第一层是web 浏览器,它提供了用户接口;中间层通常具有web
服务器以及需要访问数据库的应用程序;第三层具有数据库服务器和数据库本身。 

 

Architectures based on different Technologies:

 

•Carefully review the procedure you have carried through that enables your Apache server to support PHP.
(1) mkdir php
(2) tar ‐xjf php‐5.0.5.tar.bz2 to un‐tar it. The suffix bz2 means another compression
format. A j option is needed to run the un‐tar.
(3) ./configure
‐‐prefix=/home/2009/y2009g0/php
‐‐exec‐prefix=/home/2009/y2009g0/php
‐‐with‐mysql
‐‐with‐apxs2=/home/2009/y2009g0/apache/bin/apxs
The '‐‐prefix' specify where the PHP system locates, the '‐‐with‐mysql' tells that we are
going to access MySQL database, the '‐‐with‐apxs2' specify the file name which keep all
information about the Apache Server, the ending 2 say that you are using Apahce of
version 2.0 or higher.
(4) make
(5) make install
(6) check if there is a file named libphp5.so in the directory ~/apache/modules
(7) Edit the configuration file of Apache httpd.conf .
LoadModule php5_module modules/libphp5.so //which tells the apache to load
the PHP module when it is started.
AddType application/x‐httpd‐php .php //Which tell Apache that files with a .php
suffix are PHP script.
(8) Copy a sample php.ini to this directory by executing the following command:
cp ~/php‐5.0.5/php.ini‐dist ~/php/lib/php.ini
(9) Edit this ~/php/lib/php.ini file, turn on the switch register_globals =On. By doing
this, in PHP program, you can directly access those valuse of Form fields and Cookie
variable as a common PHP variable by refering the name.
(10) Stop the Apache Server by runing: apachectl stop
and start it by runng: apachectl start
(11) < php phpinfo( ) >
Web Application Frameworks
•MVC stands for Model-View-Controller.
Java: spring, play
Php:zend, thinkphp

•3-Tier layered software architecture stands for Presentation-Application Logic-Data Access. Please DO NOT mixed up with the 3-tier web structure mentioned above.
软件3层架构:表示层、业务逻辑层、数据访问层
Web3层架构:客户端、web服务器、后台数据库

•Understand Dependance Injection and Aspect Oriented Programming.
依赖注入:将代码内部依赖转为外部描述
缺点:问题复杂化;效率低;IDE一般不支持代码重构
优点:内部依赖变为外部配置,方便代码管理升级;减少对原有代码的侵入
面向切面:软件公共功能和业务逻辑分离(公共服务逻辑不要侵入业务逻辑)
流行对方法标注的方式;动态代理

•REST stands for Representational State Transfer.
链接构成动态应用
REST弱化了MVC

•Understand the principles of REST.
1、将资源用ID表示(URI)
2、将资源来连接在一起(Hyperlink)
3、用标准方法操作(HTTP:GET/POST等)
4、资源多重表述(Content Negotiation)
5、无状态转移(HTTP,Link)

•Understand the RESTful style URI and the general operations of HTTP.
URI:资源标识,概念上的资源,而不是实体资源
同一个URI可以获得资源的不同表示形式(HTML,XML)
同一个实体资源可能被多个URI引用
HTTP:GET(查)、POST(增)、PUT(改)、DELETE(删)

•Understand the properties and implementations of Asyncronous Programming.
响应大规模并发请求、扩展性
好处:更灵活的并发机制;
结构封装、复用;
应用:Javascript;Play框架提供了异步编程的接口;Ajax

 

转载于:https://www.cnblogs.com/wpgraceii/p/10676867.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值