Philip Repsher October 29 th, 2008 Or Maybe November 3 rd, 2008.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

4 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: Servlets.
Other Web Application Development Technologies. PHP.
CGI programming. Common Gateway Interface interface between web server and other programs (cgi scripts) information passed as environment variables passed.
Adding Dynamic Content to your Web Site
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
COEN 445 Communication Networks and Protocols Lab 4
Common Gateway Interface (CGI). CGI is a protocol: CGI is not a programming language CGI is a protocol for the exchange of information between between.
J.Sant Servlets Joseph Sant Sheridan Institute of Technology.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 Web Services.
Creating WordPress Websites. Creating a site on your computer Local server Local WordPress installation Setting Up Dreamweaver.
Servlet details Russell Beale. Servlet lifecycle The servlet container creates only one instance of each servlet Each use request handled with a separate.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Java web development Servlet & Java server pages.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Intro to Servlets Lec 26. Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Google App Engine Google APIs OAuth Facebook Graph API
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Deploying Ruby on Rails How to make your application actually serve Dan Buettner 18 Oct 2007.
Applets & Servlets.
Chapter 1: Introduction to Web
1 John Magee 9 November 2012 CS120 Lecture 17a: Publishing Web pages.
Chapter 6 The World Wide Web. Web Pages Each page is an interactive multimedia publication It can include: text, graphics, music and videos Pages are.
Basic Programming in Ruby Today’s Topics: Introduction last class irb history log Methods Classes (briefly) Using 3 rd Party Libraries rubygems ‘ require.
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 23 How Web Host Servers Work.
Standalone Java Application vs. Java Web Application
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
Chapter 3 Servlet Basics. 1.Recall the Servlet Role 2.Basic Servlet Structure 3.A simple servlet that generates plain text 4.A servlet that generates.
Lecture 11 Rails Topics SaaSSaaS Readings: SaaS book Ch February CSCE 740 Software Engineering.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
Chapter 6 Server-side Programming: Java Servlets
Ruby on Rails (Slides modified by ements-2ed.shtml)
1 Welcome to CSC 301 Web Programming Charles Frank.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
Xgooey etc. root_gui/root_framework/exweb/exam_reg xgooey, root_gui executable, ROOT File browser File mode –Local disk - ROOT File –Remote rootd server.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Field Trip #24 Setting Up a Web Server. Apache Apache is one of the most successful open source web servers In 1995 the most popular web server was the.
 To start using PHP, you can:  Find a web host with PHP and MySQL support  Install a web server on your own PC, and then install PHP and MySQL.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
WebScan: Implementing QueryServer 2.0 Karl Geiger, Amgen Inc. BRS NA UG August 1999.
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Web Interface for Formatter
Section 13 - Integrating with Third Party Tools
CSE 403: Servlet Technology
Ruby Tooling in NetBeans
By Dr. Kodge Bheemashankar G
PHP / MySQL Introduction
Build Better Apps with MEAN.
A Web-Based Data Grid Chip Watson, Ian Bird, Jie Chen,
Tiers vs. Layers.
Chapter 42 Web Services.
Chengyu Sun California State University, Los Angeles
Chengyu Sun California State University, Los Angeles
Web Application Development Using PHP
Presentation transcript:

Philip Repsher October 29 th, 2008 Or Maybe November 3 rd, 2008

 In this presentation, I will guide you through how to create a simple ruby web server and a simple ruby web client to get information from the server.  Webrick  Simplified web server library included in ruby since Ruby  net/http class  Basic Ruby framework for HTTP interaction, we will use it for our client.

 Webrick is a library included in the Ruby standard library dedicated to creating HTTP servers  Webrick is a very easy way to create HTTP servers.  A few commands -  Require “webrick”  WEBrick::HTTPServer.new(address, port)  Trap “INT”  Let’s go make a simple web server now

 The server we just made doesn’t truly do anything  After creating a server, servlets are mounted onto the server as subdirectories ( to provide more functionality  Each time a servlet is called, Ruby creates a new instance of the servlet in its own thread and runs it.

 Mount – after you make a servlet, it must be mounted on the server before the server is started.  do_GET – A method with this name will service all GET requests.  do_GET methods have two arguments, the request and the response, or req and resp.  Let’s make some servlets!

 Webrick comes installed with several useful Servlets  Filehandler – if the server is fed a path when starting it automatically sets up a filehandler to serve that directory  CGIhandler-If the directory a filehandler is set up for contains any CGI files, the server will automatically set up a CGIhandler to handle the execution of these files.

 Net/http is a ruby class that provides access to World Wide Web documents and information via HTTP.  As such, it is the class to use to make a client that will access the web server and report back.  Require ‘net/http’

 Next we need to set up the client. This client will send a request to the server for info, and then print the info out when it is received.  This client also needs to include the uri library to parse the URL for the net/http command.  We could also add some time commands to see how long the get takes.

 There are many more advanced Ruby server frameworks out there  In Particular, Ruby on Rails is very popular  Ruby on Rails is a Ruby development framework set up to assist in the making of ruby web applications, particularly database driven ones.

 servlets.html servlets.html  ml_webrick.html ml_webrick.html  doc.org/stdlib/libdoc/net/http/rdoc/index.ht ml doc.org/stdlib/libdoc/net/http/rdoc/index.ht ml   doc.org/docs/ProgrammingRuby/ doc.org/docs/ProgrammingRuby/