




























































































Studirajte zahvaljujući brojnim resursima koji su dostupni na Docsity-u
Zaradite bodove pomažući drugim studentima ili ih kupite uz Premium plan
Ova stranica nije vidljiva u pregledu
Ne propustite važne delove!





























































































Copyright (c) 2008 n + 1, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back- Cover Texts. A copy of the license is included in the section entitled ”GNU Free Documentation License”.
Page 2 ©c2009 n + 1, Inc All Rights Reserved
A.5 Lab 6.......................................... 289 A.6 Lab 7.......................................... 296 A.7 Lab 8.......................................... 303 A.8 Lab 9.......................................... 312 B GNU Free Documentation License............................. 321
Page 8 ©c2009 n + 1, Inc All Rights Reserved
Page 10 ©c2009 n + 1, Inc All Rights Reserved
8.1 Basic MVC Framework.................................... 197 9.1 Intercepting Filters...................................... 224
Page 14 ©c2009 n + 1, Inc All Rights Reserved
1.1 Introduction
Java Web Programming provides an in depth look at web based development using the Java programming environment. The course is broken into three sections. The first provides a quick overview of the HTTP protocol and review of basic HTML. The purpose of this section is to provide an understanding of the foundational elements of basic HTML development. The goal is not to provide intimate details of HTML, but to provide a basic background of HTML elements in order to create simple web pages. The second part of the course focuses on the building blocks for developing a Java web application. The primary concern will be on understanding and using Servlets and Java Server pages to develop web based applications. The class concentrates on the core elements of each technology without delving into every nuance of the interface. The final section takes the the foundational building blocks and combines them to develop a powerful web framework. One that is both robust and flexible. It provides a tour of the important web design patterns and how they are applied to create a workable web framework.
Page 16 ©c2009 n + 1, Inc All Rights Reserved
Uniform Resource Locators, URLs, are used to describe the location of a networked resource. The URL can be broken into four distinct parts for describing a location. The first part defines the protocol necessary to access the resource. The second part defines the address of the service on the network. This information is generally provided as a DNS name but the direct IP address can be used. The third section is optional and is used to tell what port or application needs to be accessed for the resource. Lastly, the URL provides information about retrieving the resource from the server’s application. The last part is known as the uniform resource identifier or URI. Below is an example URL which incorporates each of these elements.
http://nplus1.net:8080/some/location/myfile.txt
The protocol used to access the resource is the HTTP protocol. The service is located at the DNS name nplus1.net and can be found on port 8080. The resource, myfile.txt, is located at the “/some/location/” path. It is possible to add parameters to the end of the URL that can be used by the server for processing. Parameters are added to the end of the URL by first appending a “?”. Then the parameters are added as a series of name value pairs that are separated by the equal sign. Each name pair is tokenized by using the & character. The series of parameters are known as the query string. Below is an example of a URL with a query string.
http://nplus1.net:8080/servlet/myPage.html?name=foo&val=bar
In this case, there are two sets of name value pairs after the “?”. They are “name = foo” and “val = bar”. Most server side programming languages allow the developer to access these variables. Java is no exception. In fact these are integral to web based programming. It is important to note that the URI defined above does not include the query string parameters.
Page 19 ©c2009 n + 1, Inc All Rights Reserved
HTTP is the protocol used to transfer resources defined by a URL. While the HTTP protocol is used to facilitate transmission it does not actually transfer the resource. The actual transfer of the file is handled by the network protocol such as TCP/IP. HTTP is a protocol that piggy backs on top of the transfer protocols to send the actual data. Because it uses other transmission protocols there is no way to maintain state between requests. HTTP is at its most basic a simple request/response protocol between a server and a client. The server receives the request and sends a response back to the client.
Page 20 ©c2009 n + 1, Inc All Rights Reserved