1 / 38

Web Programming Final Exam - Client/Server Concepts, Web Development Languages

This final exam covers topics such as client/server web programming, basic web development concepts, web server concepts, JavaScript, PHP, Perl, CGI, Python, JSP and Servlets, internet databases concepts, and more.

cmiddleton
Download Presentation

Web Programming Final Exam - Client/Server Concepts, Web Development Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Final ExamTues 6/8/10 @ 4-5:50pm(normal class time and room)worth 35% of your course grade17 QuestionsAll short answer questions No Multiple ChoiceNo ProgrammingNo questions about language syntax

  2. Topics Covered • Client/Server Web Programming • Basic Web Development Concepts • Web Server Concepts – Apache, Tomcat • NO – HTTP, HTML, XHTML, Form Controls or CSS • JavaScript • PHP • Perl • CGI • Python • JSP and Servlets • Internet Databases Concepts and JDBC • No JavaBeans and No Java Programming Language Questions

  3. INFORMATION FROM LECTURES • No questions from: • Lecture 4, 5, 6, 7, 8, 14 • No programming questions. • No language syntax or symantec questions. • Read (questions are from): • Lecture 1, 2, 3, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21 and 22.

  4. Some of the Course goals: • Understand the technology and protocols underlying the World Wide Web • Become familiar with common tools and techniques for developing Web-based applications, both client-side and server-side • Develop a working knowledge of various scripting web languages as languages for developing Web applications • Have an understanding of what technologies can be used for various web projects and what makes the technology appropriately suited for the desired application. • Become familiar with some of the challenges and issues related to Internet Development.

  5. Client-side programming • JavaScript • a scripting language for Web pages, developed by Netscape in 1995 • uses a C++/Java-like syntax, so familiar to programmers, but simpler • good for adding dynamic features to Web page, controlling forms and GUI • can download program with Web page, execute on client machine • simple, generic, but insecure • Java applets • can define small, special-purpose programs in Java called applets • provides full expressive power of Java (but more overhead) • good for more complex tasks or data heavy tasks, such as graphics

  6. Server-side programming • can store and execute program on Web server, link from Web page • more complex, requires server privileges, but secure • CGI programming • programs can be written to conform to the Common Gateway Interface • when a Web page submits, data from the page is sent as input to the CGI program • CGI program executes on server, sends its results back to browser as a Web page • good if computation is large/complex or requires access to private data • Active Server Pages, Java Servlets, PHP, Server Side Includes • vendor-specific alternatives to CGI • provide many of the same capabilities but using HTML-like tags

  7. Lecture 3 • This lecture introduces the web technologies of SQL, ASP, ADO, ODBC, JDBC, PHP, CGI, Java Applets, JavaScript, Servlets, JSP. • Only 4 question from this lecture. • No questions on .NET or Java Webstart.

  8. Client vs. Server Side Scripting Technologies • Lecture 9 - Client-Side JavaScript • Lecture 10 - Server-Side Java Servlets • Lecture 11 - JSP • 4 questions from these lectures.

  9. Lecture 9 - JavaScript client-side programming with JavaScript

  10. JavaScript is not Java • JavaScript is a very simple scripting language. • Syntax is similar to a subset of Java. • Interpreted language. • Uses objects, but doesn't really support the creation of new object types

  11. Scripts vs. programs • a scripting language is a simple, interpreted programming language • scripts are embedded as plain text, interpreted by application • simpler execution model: don't need compiler or development environment • saves bandwidth: source code is downloaded, not compiled executable • platform-independence: code interpreted by any script-enabled browser • but: slower than compiled code, not as powerful/full-featured

  12. Common scripting tasks • adding dynamic features to Web pages • validation of form data • image rollovers • time-sensitive or random page elements • defining programs with Web interfaces • utilize buttons, text boxes, clickable images, prompts, frames • limitations of client-side scripting • since script code is embedded in the page, viewable to the world • for security reasons, scripts are limited in what they can do e.g., can't access the client's hard drive • since designed to run on any machine platform, scripts do not contain platform specific commands • script languages are not full-featured e.g., JavaScript objects are crude, not good for large project development

  13. JavaScript • JavaScript code can be embedded in a Web page using SCRIPT tags • the output of JavaScript code is displayed as if directly entered in HTML <html> <!-- js01.html --> <head> <title>JavaScript Page</title> </head> <body> <script type="text/javascript"> // silly code to demonstrate output document.write("Hello world!"); document.write("<p>How are <br />" + "<i>you</i>?</p>"); </script> <p>Here is some static text as well. </p> </body> </html> • document.writedisplays text in page • text to be displayed can include HTML tags • the tags are interpreted by the browser when the text is displayed • as in C++/Java, statements end with; • JavaScript comments similar to C++/Java • //starts a single line comment • /*…*/enclose multi-line comments

  14. The Python Programming Language • From lectures 19, 20, and 21 • Only 1 question about python

  15. PHPSee lecture 18Only 1 question on PHP

  16. What is this “PHP” thing? • Official description: • “PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Its syntax draws upon C, Java, and Perl, and is easy to learn.

  17. What does PHP do? • Most commonly: used inside a web server to parse pages and dynamically generate content. • Differs from a language like Javascript in that it is Server Side (processed on the server)

  18. PHP Document • In order to be correctly read and processed, must be parsed through a server capable of parsing PHP code. • Server processes code: formats a standard HTML document out of the PHP code, then transfers via HTTP to client browser. No client software required (other than web browser).

  19. Simple Transfer of Normal HTML Server Client Web Server Application (Apache) Client’s Browser (MSIE, Netscape, Etc) .HTML File HTML HTML

  20. Simple Transfer of PHP Server Client PHP Parsing Module Web Server Application (Apache) Client’s Browser (MSIE, Netscape, Etc) .PHP File PHP & HTML HTML HTML

  21. What does a PHP file look like? • <html> • <p>Hello • <?php • echo “world!”; • ?> • </p> • </html>

  22. Parsing… • <html> • <p>Hello • <?php • echo “world!”; • ?> • </p> • </html> • <html> • <p>Hello • world • </p> • </html>

  23. CGI Programming See lecture 15 Only 2 question on CGI

  24. Client-side recap • JavaScript provides for client-side scripting • source code is downloaded with the Web page • interpreted by the browser as the page is loaded • simple execution model, language is closely integrated with HTML • Java Applets provides for client-side programming • source code is compiled into Java byte code on server • byte code is downloaded with the Web page • interpreted by the Java Virtual Machine in the browser • more complicated model, requires compiler on server • (slightly) faster execution, full-featured with extensive library support • both approaches yield platform independence • requires JavaScript/Java enabled browser for desired platform

  25. Server-side vs. client-side programming • instead of downloading the program and executing on the client, • have the client make a request • execute the program on the server • download the results to the client • advantages • cross-platform support • browser variations/bugs yield differences with JavaScript & Java applets • with server-side, only have to test & optimize program for server platform • more options for applications • server-side program not limited for security reasons, can access files & databases • increased power • server machines tend to be more powerful, better tools • code integrity • do not have to give client access to source code or data in order to execute

  26. Common server-side applications • search engines • must maintain a large database of links & documents • must be able to index, sort data, perform complex searches • requires lots of storage, optimum performance  server-side • database access • Web page can serve as front-end to a database • make requests from browser, passed on to Web server, calls CGI program to access the database, sends the results back to the browser • chat & bulletin board services • user enters messages in a Web interface, passed on to server • chat: CGI program distributes messages to all connected users • bulletin board: CGI program adds to accessible database of messages

  27. CGI programming • CGI (Common Gateway Interface) • protocol for input/output of a server-side program • program can be written in any language as long as it accepts input and produces output as specified by CGI • server must be able to recognize a URL as being a CGI program generally done by placing program in special cgi-bin directory • to execute a CGI program • server receives a request • server must recognize that the URL maps to a program, not a document • server executes program • feeds data from request message to program as output • takes program output, adds appropriate HTTP headers, and sends back

  28. CGI output • The output of a CGI program consists of • HTTP headers • blank line • program output to be displayed/downloaded • At minimum, HTTP header must specify content type • which is then passed on by the Web server as an HTTP header e.g., Content-Type: text/html • At minimum, output can be plain text • which is passed on by the Web server as the HTML document e.g., Hello and welcome to my page

  29. CGI example • // hello.cpp • #include <iostream> • using namespace std; • int main() • { • cout << "Content-Type: text/html" << endl • << endl; • cout << "Hello and welcome to my page " << endl; • return 0; • } executable is stored in the cgi-bin under the name hello.cgi GET request executes the program

  30. Introduction to PerlSee lecture 162 questions on Perl

  31. What is Perl? • Practical Extraction and Report Language • A scripting language which is both relatively simple to learn and yet remarkably powerful.

  32. Introduction to Perl • A “glue” language. Ideal for connecting things together, such as a GUI to a number cruncher, or a database to a web server. • Has replaced shell programming as the most popular programming language for text processing and Unix system administration. • Runs under all operating systems (including Windows). • Extremely popular for CGI and GUI programming.

  33. Why use Perl ? • It is easy to gain a basic understanding of the language and start writing useful programs quickly. • There are a number of shortcuts which make programming ‘easier’. • Perl is popular and widely used, especially for system administration and WWW programming.

  34. Why use Perl? • Perl is free and available on all computing platforms. • Unix/Linux, Windows, Macintosh, Palm OS • There are many freely available additions to Perl (‘Modules’). • Most importantly, Perl is designed to understand and manipulate text and lists.

  35. #!/usr/bin/perl #This script prints a friendly greeting to the screen print “Hello World\n”; A Simple Perl script • Scripts are first “compiled” and then “executed” in the order in which the lines of code appear • You can write a script with any text editor. The only rule is that it must be saved as plain text.

  36. Database Connectivity and Internet Technologies Overview • Lecture 22 – This is a nice summary lecture that provides a lot of Server Technology conclusions. • No questions on Cold Fusion, No questions on Server Tiers. This is just a good summary lecture. • There are 5 scenario questions asking you to pick scripting languages and/or server technologies to solve a problem.

  37. Class Summary questions to ponder… • What technologies are available for the internet? • Why would you want to use a particular scripting languages? • How does one language support something another does not? • The difference between client side and server side applications. • What are the basic parts of an HTML, Perl, PHP, CGI document? • How would you use these technologies to accomplish a task or provide a solution to a problem? • If given a scenario, which language and/or technology would you choose and why?

  38. Final ExamTues 6/8/10 @ 4-5:50pm(normal class time and room)worth 35% of your course grade17 QuestionsAll short answer questions No Multiple ChoiceNo ProgrammingNo questions about language syntax

More Related