


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A lecture from the University of Wisconsin-Madison on the topic of web programming. It provides an introduction to the web, its history, and its evolution into a dominant method for interacting with server-based computerized systems. The lecture covers the technical definition of the web, including the rules for encoding web documents and the rules for how client and server software interact with each other. It also discusses the web client software, including the web browser, its main goal, and the protocols that describe the rules for how it interacts with the server. The lecture concludes by discussing the challenges of building web pages, including the need to understand both the standards for displaying documents and how various browser implementations behave.
Typology: Lecture notes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



The web started out as a distributed solution for accessing through the Internet documents hosted by various organizations on their servers. The most revolutionary feature of the web is that it allows the documents to contain hyperlinks pointing to other documents on a server somewhere on the Internet. These hyperlinks (for short links) form a global web of connected documents hence the name “the world-wide web”.
Today’s web is much more than a distributed repository of static documents. Clients can send information to the servers, web pages can be generated dynamically, and rich forms of interaction between the user and the web client are supported. The web has become the dominant method for interacting with server-based computerized systems. Web-based applications range from publicly accessible weather forecasting pages to complex systems tracking everything from customer information to inventories of spare parts that allow companies large and small to function more efficiently.
At the core of the technical definition of the web are the rules for encoding the web documents and the rules for how the client and the server software interact with each other (called protocol ). To be able to build web applications one also needs to understand what the web client and the server do and how they can be extended. This lecture gives a brief introduction into these four central topics. Future lectures will address each of them in more detail.
The term web client can be used to denote the computer a user uses to access the web, or the software on that computer that is used to access the web. In this class we most often use the second meaning and it should be clear from the context what we mean. The web client software, also called the web browser, is a complex program. Its main goal is to request and receive web pages from various servers as directed by the user and to render (to display) them. Protocols describe the rules for how the browser interacts with the server. Various standards describe how it should display the documents it receives.
Unfortunately, to build web pages one needs not only understand the standards for displaying documents, but also to some extent how various browser implementations behave. There are small details about how documents should be displayed that the standards do not specify. Individual browser implementations sometimes make different choices. It is also common for browsers to use non-standard extensions. It is not uncommon for later versions of standards to incorporate popular browser-specific extensions. Currently the dominant browsers are various versions of Microsoft’s Internet Explorer and various browsers based on open-source the Mozilla core such as Firefox. Apple’s Safari and Opera are also used by a significant number of people. Some browser variants are specifically customized to operate on handheld devices (personal digital assistants, mobile phones). Compared to desktop or laptop computers, these devices have smaller screens, less memory, weaker processors, and more limited forms of user
interaction and these factors influence the web browsers also. In this class we will focus on Internet Explorer and Firefox for Windows – in a “real world setting” you may have to worry about more browsers.
Another important role of the browser is to execute programs embedded in web pages. These programs give the author of web pages a rich collection of methods for interacting with the user. There are two main types of programs that browsers need to handle: scripts and applets. Applets are written in Java and they take control of a portion of the page. They can use flexible graphical primitives to draw their portion of the page. Web page scripts are in a language called JavaScript. JavaScript has weaker graphical abilities (it can only control the appearance and placement of page elements), but it is more extensively integrated with the browser and it has more extensive user interaction capabilities than the applets. JavaScript is extensively used in modern interactive web pages while applets are less common. In this class we will focus on JavaScript and not address applets any further.
Feature Scripts Applets Language JavaScript Java Access to local files No No Network transfers Limited Limited Graphics Limited (HTML) Strong User interaction Extensive Limited Typical uses Interactive pages Web games Covered in class Yes No
Table 1: Comparison of types of programs embedded in web pages
Interactions between the browser and the web server are governed by a strict set of rules called the hypertext transfer protocol or HTTP. This protocol describes the types of messages the server and the client can send to each other, the meanings of the various fields in those messages, the order in which those messages can be sent, and the way to handle various error conditions. The reason for having a strict set of detailed rules about the allowed interactions is to make it possible for different groups of implementers to build browsers and web server software that can interoperate seamlessly. Such a protocol is just an important special case of an interface that specifies how two parts of the system can interact. As long as the interface is not affected, the different parts can change independently. The implementers of web server software do not need to know about all the browsers implementations in the world, they just need to ensure that their software complies with the protocol. Similarly the implementers of browsers need to ensure that they comply with the protocol and the details of various web server implementations are hidden to them. The Internet has many other protocols that govern other applications such as email or chat or infrastructure services not directly visible to users.
HTTP is a request-reply protocol. The client first initiates a connection with the server, it sends a request with the name of the document it wants and the server sends a reply
some traditional desktop applications (programs running directly on client computers). To gain some understanding of what type of applications are best suited for web-based implementations it is instructive to contrast web-based applications and desktop applications. Deploying applications to the desktop has clear advantages when extensive graphics are important (e.g. some games) and when it is important that the application be able to operate without a network connection. Web applications are more widely accessible as any computer with a browser and an Internet connection can access a site, there is no need to install a separate client for each application. Web applications are also easier to update because updates need to be rolled out at the server only. This makes it easier to upgrade often. We do not expect the web applications to make traditional desktop applications obsolete, but they are finding an increasing number of uses and we expect them to have broad impact for the foreseeable future.
Feature Web app. Desktop app. Graphics Limited Unlimited User interaction Extensive Unlimited Network usage High Varies Disconnected operation No Yes Accessible from Any computer Where installed Upgrading functionality At server At desktop Popularity Increasing Dominant
Table 2: Comparing web applications and desktop applications
Hypertext markup language or HTML is used for encoding web pages. It is a text-based format that uses tags to convey information about the structure and formatting of the page. HTML was designed so that the writer of the web page does not control very strictly the formatting to allow browsers to format the page according to their constraints (e.g. screen size) and the preferences of the user (e.g. some people like bigger fonts). A defining feature of HTML is that it includes a tag for defining hyperlinks to other documents (referenced using URLs). There are tools for writing web pages that allow the author to write the page without explicitly writing tags. But to gain even a shallow understanding of the web it is essential to gain some understanding of HTML. Below is an example of a very simple web page.
Bucky Badger’s web page
Welcome to Bucky's web page
I am Bucky, the mascot for University of Wisconsin athletics. Please visit
the web page of our football team and
the web page of our basketball team.