CSE 4225 Network Programming Lecture 5: Web Architecture

Spring – 2015 Solaiman Salvi

Spring '15

CSE 4225 | Network Programming

2

Spring '15

CSE 4225 | Network Programming

3

Spring '15

CSE 4225 | Network Programming

4

Spring '15

CSE 4225 | Network Programming

5

Spring '15

CSE 4225 | Network Programming

6

Spring '15

CSE 4225 | Network Programming

7

WWW

STATIC WEB DOCUMENTS

Spring '15

CSE 4225 | Network Programming

8

Static Web Documents • Web pages are static • Just files sitting on some server waiting to be retrieved - even a video is a static Web page because it is just a file • MarkUp languages – language for describing how documents are formatted.

Spring '15

CSE 4225 | Network Programming

9

Spring '15

CSE 4225 | Network Programming

10

Static Web Pages (1)

The HTML for a sample Web page. Spring '15

CSE 4225 | Network Programming

11

Static Web Pages (2)

The formatted page. Spring '15

CSE 4225 | Network Programming

12

Static Web Pages (3)

Some differences between HTML versions. Spring '15

CSE 4225 | Network Programming

13

Style Sheets • A way to prevent different pages from having a different appearance • Individual pages no longer use physical styles, such as boldface and italics. • Page authors use logical styles such as (define), (weak emphasis), . • Logical styles are defined in the style sheet, which is referred to at the start of each page. • compared to an #include file in a C program Spring '15

CSE 4225 | Network Programming

14

Problem of HTML • HTML does not provide any structure to Web pages. • It also mixes the content with the formatting. • E-commerce and other applications need those. • A program that searches the Web for the best price for some book or CD needs to analyze many Web pages looking for the item's title and price. • With Web pages in HTML, it is very difficult for a program to figure out where the title is and where the price is. Spring '15

CSE 4225 | Network Programming

15

XML & XSL • 2 new languages – XML (eXtensible Markup Language) describes Web content in a structured way – XSL (eXtensible Style Language) describes the formatting independently of the content

Spring '15

CSE 4225 | Network Programming

16

Spring '15

CSE 4225 | Network Programming

17

XSL • All it says – Product Details, nothing about how to display the Web page on the screen. • To provide the formatting information, we need a .xsl file, containing the XSL definition. • This file is a style sheet that tells how to display the page. Interprets XML to HTML. • The XML and XSL specifications are much stricter than HTML specification. • Rejecting syntactically incorrect files is mandatory, even if the browser can determine what the Web designer meant Spring '15

CSE 4225 | Network Programming

18

Spring '15

CSE 4225 | Network Programming

19

XML & SOAP • XML – also used as language for communication between application programs. • SOAP – way for performing RPCs between applications in a language and system-independent way. • Client constructs the request as an XML message and sends it to the server, using the HTTP protocol • Server sends back a reply as an XML formatted message. • In this way, applications on heterogeneous platforms can communicate. Spring '15

CSE 4225 | Network Programming

20

XHTML • In the future, the majority of Web-enabled devices will not be PCs, but wireless, handheld PDA-type devices – limited memory for large browsers – full of heuristics that try to somehow deal with syntactically incorrect Web pages

• Solution – XHTML - HTML 4 reformulated in XML, not HTML 5 Spring '15

CSE 4225 | Network Programming

21

• Six major differences and a variety of minor differences between XHTML and HTML 4

Spring '15

CSE 4225 | Network Programming

22

Spring '15

CSE 4225 | Network Programming

23

Spring '15

CSE 4225 | Network Programming

24

FORMS • When the user clicks the submit button, the browser packages the collected information into a single long line and sends it back to the server for processing. • The & is used to separate fields • + is used to represent space.

Spring '15

CSE 4225 | Network Programming

25

WWW

DYNAMIC WEB DOCUMENTS

Spring '15

CSE 4225 | Network Programming

26

Dynamic web content • Content/file generated on demand/when requested (on a HTTP request), rather than stored on disk • Content generation can take place either on the server side or on the client side.

Spring '15

CSE 4225 | Network Programming

27

Server Side Dynamic Web Page • 1. Programs – CGI (Common Gateway Interface)

• Written in – perl/pyhton • Lives in a directory called cgi-bin - visible in the URL • A CGI program is executed in a separate process. Spring '15

CSE 4225 | Network Programming

28

2. Server Side Scripting • CGI scripts - not the only way to generate dynamic content on the server side. • Another common way – – embed little scripts inside HTML pages – have them be parsed & executed by the server itself to generate the page. – The result is included in the place of the code. – language for writing these scripts – • • • •

Spring '15

Active Server Pages (ASP) from Microsoft, Server-side JavaScript from Netscape, Java Server Pages (JSP) from Sun, Hypertext Preprocessor (PHP)

CSE 4225 | Network Programming

29

Spring '15

CSE 4225 | Network Programming

30

PHP

(a)

(c)

(b)

(a) A Web page containing a form. (b) A PHP script for handling the output of the form. (c) Output from the PHP script when the inputs are ‘‘Barbara’’ and ‘‘32’’, respectively. Spring '15

CSE 4225 | Network Programming

31

Spring '15

CSE 4225 | Network Programming

32

3. Java Servlets • Java Servlets live in server-side JVM. – doGet, doPost, doPut, doDelete, init, destroy – HTML is “embedded” in Java code. – Servlets can call Enterprise JavaBeans (EJB).

Spring '15

CSE 4225 | Network Programming

33

Spring '15

CSE 4225 | Network Programming

34

Spring '15

CSE 4225 | Network Programming

35

Client Side Dynamic Web page • CGI, PHP, JSP, and ASP scripts can’t respond to mouse movements or interact with users directly. • So needs scripts embedded in HTML pages that are executed on the client machine, rather than the server machine • HTML 4.0 allows such scripts, tag

Recommend Documents

CSE 4225 Network Programming
Apr 15, 2003 - ... libwww/2.1.4. • Host: www.cafeaulait.org. • \r\n\r\n. Spring'15. CSE 4225 | Network Programming. 11 ... Server: Apache/2.0.40 (Red Hat Linux).

CSE 425 Network Programming
Remote Method Invocation (RMI), allows one host to run programs on another host that is running a program on a remote host from a local machine. • RMI is a core Java API and class library that allows Java programs running in one Java virtual machin

CSE 425 Network Programming
Print servers, distributed file systems (DFS), DNS, rlogin;. – WWW: web ... System Service Tier (e.g. persistent storage) .... enterprise services based on RMI/IIOP.

Java Network Programming
class ClientTCP { public static void main(String args[]) throws UnknownHostException, IOException {. Socket s=new Socket("www.upv.es",80);. Scanner in=new Scanner(s.getInputStream());. PrintWriter out=new PrintWriter(s.getOutputStream(),true); out.pr

Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-II.pdf
Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-II.pdf. Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-II.pdf. Open. Extract. Open with. Sign In.

Scheme-SVIIT-CSE-DD_28B.Tech_2BM. Tech_29-CSE-V.pdf
Scheme-SVIIT-CSE-DD_28B.Tech_2BM. Tech_29-CSE-V.pdf. Scheme-SVIIT-CSE-DD_28B.Tech_2BM. Tech_29-CSE-V.pdf. Open. Extract. Open with. Sign In.

Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VIII.pdf
Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VIII.pdf. Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VIII.pdf. Open. Extract. Open with. Sign In.

Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-III.pdf
Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-III.pdf. Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-III.pdf. Open. Extract. Open with. Sign In.

Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VII.pdf
Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VII.pdf. Scheme-SVIIT-CSE-DD_28B.Tech_2BMBA_29-CSE-VII.pdf. Open. Extract. Open with. Sign In.

MC7404-Network Programming question bank_edited.pdf ...
1. What is meant by Shell in Unix? 2. What is Program and Process in Unix? 3. Give the memory layout of a C program. 4. Explain environment variables in Unix.

Foundations of Python Network Programming, 2nd Edition.pdf ...
Foundations of Python Network Programming, 2nd Edition.pdf. Foundations of Python Network Programming, 2nd Edition.pdf. Open. Extract. Open with. Sign In.

tcl network programming pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. tcl network ...

Advanced Network Programming - Principles and Techniques.pdf ...
Advanced Network Programming - Principles and Techniques.pdf. Advanced Network Programming - Principles and Techniques.pdf. Open. Extract. Open with.

Beej's Guide to Network Programming
Hey! Socket programming got you down? Is this stuff just a little too difficult to figure out from the man pages? You want to do cool Internet programming, but you don't have time to wade through a gob of structs trying to figure out if you have to c

Syllabus-SVIIT-CSE-M.Tech-CSE-I.pdf
Syllabus-SVIIT-CSE-M.Tech-CSE-I.pdf. Syllabus-SVIIT-CSE-M.Tech-CSE-I.pdf. Open. Extract. Open with. Sign In. Main menu.

SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -III.pdf
Try one of the apps below to open or edit this item. SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -III.pdf. SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -III.

SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -II.pdf
... Engineering Drawing 60 20 20 30 20 3 0 4 5 150. 4 IBTCS204 Computer Peripherals and. Interfaces 60 20 20 0 50 3 1 2 5 150. 5 IBTEE102 Fundamentals of ...

SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -VI.pdf
Try one of the apps below to open or edit this item. SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -VI.pdf. SCHEME-SVITS-CSE-IP(B.Tech.+M.Tech.)-CSE -VI.

Scheme-SVIIT-CSE-M.Tech-CSE-III.pdf
Scheme-SVIIT-CSE-M.Tech-CSE-III.pdf. Scheme-SVIIT-CSE-M.Tech-CSE-III.pdf. Open. Extract. Open with. Sign In. Main menu.

Scheme-SVIIT-CSE-BTech-CSE-III.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

CSE 1200
Calendar program. 2. Student Management System ... 24. Pay roll system. 25. Inventory Management System ... Address Book. 41. Student Information System.