Lab session Google Application Engine - GAE. Navid Nikaein

Similar documents
Servlets by Example. Joe Howse 7 June 2011

INTRODUCTION TO SERVLETS AND WEB CONTAINERS. Actions in Accord with All the Laws of Nature

Servlets1. What are Servlets? Where are they? Their job. Servlet container. Only Http?

Session 9. Introduction to Servlets. Lecture Objectives

sessionx Desarrollo de Aplicaciones en Red A few more words about CGI CGI Servlet & JSP José Rafael Rojano Cáceres

Session 8. Introduction to Servlets. Semester Project

Advanced Internet Technology Lab # 4 Servlets

Introduction to Servlets. After which you will doget it

Session 10. Form Dataset. Lecture Objectives

Handout 31 Web Design & Development

Servlet for Json or CSV (or XML) A servlet serving either Json or CSV (or XML) based on GET parameter - This version uses org.json

CE212 Web Application Programming Part 3

Database Systems Lab. 11. JSP I 충남대학교컴퓨터공학과 데이타베이스시스템연구실

JAVA SERVLET. Server-side Programming INTRODUCTION

Web based Applications, Tomcat and Servlets - Lab 3 -

ServletConfig Interface

Servlet Basics. Agenda

JavaServer Pages (JSP)

HTTP status codes. Setting status of an HTTPServletResponse

AJP. CHAPTER 5: SERVLET -20 marks

SSC - Web applications and development Introduction and Java Servlet (I)

The Basic Web Server CGI. CGI: Illustration. Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems 4

Servlets and JSP (Java Server Pages)

Servlet and JSP Review

Java Enterprise Edition. Java EE Oct Dec 2016 EFREI/M1 Jacques André Augustin Page 1

Servlet Fudamentals. Celsina Bignoli

Introduction. This course Software Architecture with Java will discuss the following topics:

Introduction. Literature: Steelman & Murach, Murach s Java Servlets and JSP. Mike Murach & Associates Inc, 2003

Stateless -Session Bean

Getting started with Winstone. Minimal servlet container

COMP9321 Web Application Engineering

Developing a Mobile Web-based Application with Oracle9i Lite Web-to-Go

COMP9321 Web Application Engineering

Ch04 JavaServer Pages (JSP)

CIS 3952 [Part 2] Java Servlets and JSP tutorial

Using Java servlets to generate dynamic WAP content

Accessing EJB in Web applications

AIM. 10 September

To follow the Deitel publishing program, sign-up now for the DEITEL BUZZ ON-

Backend. (Very) Simple server examples

Advanced Web Technology

CS 112 Introduction to Programming

Session 8. JavaBeans. Reading & Reference. Reading. Reference. Session 8 Java Beans. 2/27/2013 Robert Kelly, Head First Chapter 3 (MVC)

Chapter 2 How to structure a web application with the MVC pattern

Demonstration of Servlet, JSP with Tomcat, JavaDB in NetBeans

Java servlets CSCI 470: Web Science Keith Vertanen Copyright 2013

Unit-4: Servlet Sessions:

Servlet. 1.1 Web. 1.2 Servlet. HTML CGI Common Gateway Interface Web CGI CGI. Java Applet JavaScript Web. Java CGI Servlet. Java. Apache Tomcat Jetty

Java Card 3 Platform. Peter Allenbach Sun Microsystems, Inc.

112. Introduction to JSP

LAB 1 PREPARED BY : DR. AJUNE WANIS ISMAIL FACULTY OF COMPUTING UNIVERSITI TEKNOLOGI MALAYSIA

Contents at a Glance

Java Server Pages JSP

CS506 Web Design & Development Final Term Solved MCQs with Reference

CSC309: Introduction to Web Programming. Lecture 10

Université Antonine - Baabda

112-WL. Introduction to JSP with WebLogic

Principles and Techniques of DBMS 6 JSP & Servlet

Implementation Architecture

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

LearningPatterns, Inc. Courseware Student Guide

Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang

Penetration: from application down to OS

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

Advanced Topics in Operating Systems. Manual for Lab Practices. Enterprise JavaBeans

Database Applications Recitation 6. Project 3: CMUQFlix CMUQ s Movies Recommendation System

UNIT-V. Web Servers: Tomcat Server Installation:

WHITE LABELING IN PROGRESS ROLLBASE PRIVATE CLOUD

Introduction to Java Servlets. SWE 432 Design and Implementation of Software for the Web

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

2. Follow the installation directions and install the server on ccc. 3. We will call the root of your installation as $TOMCAT_DIR

Connecting the RISC Client to non-javascriptinterfaces

This tutorial will teach you how to use Java Servlets to develop your web based applications in simple and easy steps.

a. Jdbc:ids://localhost:12/conn?dsn=dbsysdsn 21. What is the Type IV Driver URL? a. 22.

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

Servlets. An extension of a web server runs inside a servlet container

Groovy and Grails in Google App Engine

CSC309: Introduction to Web Programming. Lecture 11

Introduction. This course Software Architecture with Java will discuss the following topics:

Fast Track to Java EE

Wireless Java Technology

Web Application Architecture (based J2EE 1.4 Tutorial)

Implementation Architecture

Java Servlets. Preparing your System

Handling the Client Request: HTTP Request Headers

Web Programming. Lecture 11. University of Toronto

Kamnoetvidya Science Academy. Object Oriented Programming using Java. Ferdin Joe John Joseph. Java Session

Introduction to JSP and Servlets Training 5-days

Module 4: SERVLET and JSP

Session 20 Data Sharing Session 20 Data Sharing & Cookies

JSR 311: JAX-RS: The Java API for RESTful Web Services

Java TM. JavaServer Faces. Jaroslav Porubän 2008

Cloud Computing Platform as a Service

JdbcResultSet.java. import java.sql.*;

Copyright 2014 Blue Net Corporation. All rights reserved

Advance Java. Configuring and Getting Servlet Init Parameters per servlet

Fast Track to Java EE 5 with Servlets, JSP & JDBC

Front-end / Back-end. How does your application communicate with services?

SERVLETS INTERVIEW QUESTIONS

Web Application Services Practice Session #2

Transcription:

Lab session Google Application Engine - GAE Navid Nikaein

Available projects Project Company contact Mobile Financial Services Innovation TIC Vasco Mendès Bluetooth low energy Application on Smart Phone Proximity Traffic Safety Warning E-mobility Proximity Charging Service Clustering usage pattern of mobile devices ST semiconductor Eurecom Eurecom EURECOM Lionel Chastion Jerome Haerri Jerome Haerri Soumya Datta Mobile Travel Assistant 3Hpartner Stefano Crosta 25/12/2013 - - p 2

From the Last Session From offline to walled-garden to a true-online access Wireless system and technology evolution Run time environments OS war Mobile OS vs application-specific execution environment App store 25/12/2013 - - p 3

Overall Interactions FML XHTML HTML for display HTTP for transport WML XML dialects XSLT (Transformations) (X)HTML XML HTTP Server XML for Data Client-side Programming Clients (browsers) URL/URI for addressing Server-side Programming DB Access, Web Services Source: P. Michiardi, S. Crosta 4

Protocol Interaction Client Web server HTTP HTTP message HTTP TCP Router TCP segment Router TCP IP IP packet IP IP packet IP IP packet IP L1/L2 L1/L2 SONET interface SONET interface Ethernet interface Ethernet interface Air Interface SONET link Ethernet Source: P. Michiardi 5

Client- vs Server-side Programming Client-side HTML and script sent to client Script processed before display Script visible to client <HTML> <SCRIPT> echo "Hello" </SCRIPT> Server-side Script processed before sending HTML to client Client receives and displays processed HTML Script hidden from client <HTML> <SCRIPT> echo "Hello" </SCRIPT> <HTML> <SCRIPT> echo "Hello" </SCRIPT> <HTML> Hello <HTML> Hello Source: P. Michiardi, S. Crosta <HTML> Hello 6

Servlet job and life cycle Extend the server capabilities by means of request-response programming model Usage Read and store data and process request from the client Send data / response back to the client Build a dynamic content Manage state information See http://en.wikipedia.org/wiki/java_servlet & http://en.wikibooks.org/wiki/j2ee_programmin g/servlet 25/12/2013 - - p 7

Servlet Servlet container Manage the life cylce Dispatch/mapping the URL Servlet API Packege : javax.servlet.* Different data format may exist Html, xml, json 25/12/2013 - - p 8

Project structure and files Project structure src/ war/ WEB-INF/ appengine-generated/ classes/ lib/ appengine-web.xml web.xml Web.xml <servlet> <servlet-name>helloworldgae</servlet-name> <!-- class name --> <servletclass>eurecom.fr.helloworldgae.helloworldg aeservlet</servlet-class> <!-- class tree --> </servlet> <servlet-mapping> <servlet-name>helloworldgae</servlet-name> <!-- class name --> <url-pattern>/helloworldgae</url-pattern> </servlet-mapping> <!-- Class pattern in the URL--> 25/12/2013 - - p 9

Servlet Java class that runs on the server side that receives HTTP data and does a processing or more following the contraints of the HTTP protocol @WebServlet("/Hello") public class Hello extends HttpServlet { // called at the reception of the http POST request protected void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { } response.setcontenttype("text/html;charset=utf-8"); PrintWriter out = response.getwriter(); try { out.println("hello World"); } finally { } out.close(); } // called at the reception of the http GET request protected void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { response.setcontenttype("text/plain"); String msg = "Hello, world"; if (request.getparameter("name")!= null) { } msg += " from " + request.getparameter("name"); response.getwriter().println(msg); - p 10

HTTP Response Response type (see http://www.w3.org/protocols/rfc2616/rfc2616-sec10.html ) 1XX: informative 2XX: success 3XX: redirection 4XX: client error 5XX: server error Generate error protected void doxxx(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { response.setcontenttype("text/html;charset=utf-8"); PrintWriter out = response.getwriter(); try { response.senderror(httpservletresponse.sc_service_unavailable, "the server is overloaded. Please try later."); } finally { out.close(); } } See http://en.wikibooks.org/wiki/j2ee_programming/servlet 25/12/2013 - - p 11

Java server pages - JSP The JavaServer Pages is a technology for inserting dynamic content into a HTML or XML page using a Java servlet container Declaration: <%! int serverinstancevariable = 1; %> Scriptlet : <% int localstackbasedvariable = 1; out.println(localstackbasedvariable); %> Expression: <%= "expanded inline data " + 1 %> Comment: <%-- This is my first JSP. --%> Directive : <%@ page import="java.util.*" %> 25/12/2013 - - p 12

Lab Session Steps 1. Helloworldgae [10 minutes] 2. Hellomoongae [40 minutes] 1. Create a servlet 2. JSP 3. Publish and deploy the code 3. AddressBook [1h30] 1. Database 2. POST and GET 3. List of contact and contact details 4. Modify contact 5. Output format in json 4. Website [10 minutes] 25/12/2013 - - p 13

Technology Google App Engine GAE PaaS cloud computing platform Developping and hosting web applications in google data center See https://developers.google.com/appengine/ and http://en.wikipedia.org/wiki/google_app_engine Appache Tomcat (formerly Jakarta Tomcat) open source web server and servlet container Implemnets java servlet and javaserver pages 25/12/2013 - - p 14

EURECOM MEMBERS 25/12/2013 - - p 15