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

Size: px
Start display at page:

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

Transcription

1 Table of Contents Advanced Web Technology 13) Google Web Toolkits 2 - GWT, Communication Emmanuel Benoist Fall Term Internationalization Static String i18n Remote Procedure Code JSON Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Internationalization Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Internationalization : I18N Module Core types related to internationalization: LocaleInfo Provides information about the current locale. Constants Useful for localizing typed constant values Messages Useful for localizing messages requiring arguments ConstantsWithLookup Like Constants but with extra lookup flexibility for highly data-driven applications Dictionary Useful when adding a GWT module to existing localized web pages Localizable Useful for localizing algorithms encapsulated in a class or when the classes above don t provide sufficient control DateTimeFormat Formatting dates as strings. See the section on date and number formatting. NumberFormat Formatting numbers as strings. See the section on date and number formatting. Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 3 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 4

2 Static String i18n Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 5 Implement the Constants Interface Create the StockWatcherConstants interface Uses annotations for the default translation Implements the Constant interface (GWT) Bound automatically to the StockWatcherConstants*.properties files The java file must contain one method for each of the constants in the properties files The right value is found at runtime, corresponding to the locale Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 7 Interantionalizing Strings Implement the Constant Interface Contains only static strings Very efficient and compiled once. Implement the Messages Interface Allows to insert values in the string For instance numbers or dates Equivalent to the resource bundle in applications. Dynamic String Internationalization The Dictionary class lets your GWT application consume strings supplied by the host HTML page. Convenient if your existing web server has a localization system that you do not wish to integrate with the static string internationalization methods. Implement the Localizable Interface The most powerful technique allows you to go beyond simple string substitution create localized versions of custom types. Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 6 Example: the Constants file import com.google.gwt.i18n.client.constants; public interface StockWatcherConstants extends Constants StockWatcher ) String Symbol ) String Price ) String Change ) String Remove ) String Add ) String add(); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 8

3 Translate it to German Implement the Messages interface Create a file StockWatcherConstants de.properties stockwatcher = Aktienbeobachter symbol = Symbol price = Kurs change = Änderung remove = Entfernen add = Hinzufügen For Strings containing information Similar to resource bundles in Java Can contain strings with parameters {0 ist kein gültiges Aktiensymbol. The number is a place holder mystring = First parm is {0, second parm is {1, third parm is {2. Usefull for integrating dates, prices, internationalized results Usefull but less efficient. The strings must be produced at runtime Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 9 Messages file Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 10 The corresponding properties file import com.google.gwt.i18n.client.messages; import java.util.date; public interface StockWatcherMessages extends Messages {0 is not a valid symbol. ) String invalidsymbol(string symbol); StockWatcherMessages de.properties file. lastupdate = Letzte Aktualisierung: {0,date,medium {0,time, medium invalidsymbol = {0 ist kein gültiges Last update: {0,date,medium {0,time, medium ) String lastupdate(date timestamp); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 11 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 12

4 Replace content Replace content (Cont) Replace the texts with place holders <body> <img src= images/googlecode.png /> <h1 id= apptitle ></h1> Replacing strings set programmatically Create the instances of the classes (internationalized) private ArrayList<String> stocks = new ArrayList<String>(); private StockWatcherConstants constants = GWT.create( StockWatcherConstants.class); private StockWatcherMessages messages = GWT.create( StockWatcherMessages.class); Set the content: // Set the window title, the header text, and the Add button text. Window.setTitle(constants.stockWatcher()); RootPanel.get( apptitle ).add(new Label(constants. stockwatcher())); addstockbutton = new Button(constants.add()); // Create table for stock data. stocksflextable.settext(0, 0, constants.symbol()); stocksflextable.settext(0, 1, constants.price()); stocksflextable.settext(0, 2, constants.change()); stocksflextable.settext(0, 3, constants.remove()); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 13 Add a supported locale: Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 14 Client Server Communication Inside StockWatcher.gwt.xml add the property <entry point class= com.google.gwt.sample. stockwatcher.client.stockwatcher /> <extend property name= locale values= de /> </module> Load the german version by adding &locale=de Remote Procedure Code From Java To Java Supported by the language Optimized and easy to test JSON For communicating with the same server JSONP For cross server communication Overgoes the Same Origin Policy Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 15 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 16

5 Remote Procedure Code GWT Remote Procedure Call RPC contains: the service that runs on the server the method you are calling the client code that invokes the service the Java data objects that pass between the client and server Both (client and server) must serialize and deserialize the objects You need to write three components Define the interface StockPriceService that extends RemoteService and lists all your RPC methods Create a class StockPriceServiceImpl that extends RemoteServiceServlet and implements the interface you created above. Define an asynchronous interface StockPriceServiceAsync to your service to be called from the client-side code. Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 17 GWT Remote Procedure Call 1 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 18 StockPriceService interface In the package com.google.gwt.sample.stockwatcher.client import com.google.gwt.user.client.rpc.remoteservice; import com.google.gwt.user.client.rpc. stockprices ) public interface StockPriceService extends RemoteService { StockPrice[] getprices(string[] symbols); 1 Source: code.google.com Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 19 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 20

6 StockPriceServiceImpl class package com.google.gwt.sample.stockwatcher.server; import com.google.gwt.sample.stockwatcher.client.stockprice; import com.google.gwt.sample.stockwatcher.client.stockpriceservice; import com.google.gwt.user.server.rpc.remoteserviceservlet; import java.util.random; public class StockPriceServiceImpl extends RemoteServiceServlet implements StockPriceService { private static final double MAX PRICE = 100.0; // $ private static final double MAX PRICE CHANGE = 0.02; // +/ 2% public StockPrice[] getprices(string[] symbols) { Random rnd = new Random(); StockPrice[] prices = new StockPrice[symbols.length]; for (int i=0; i<symbols.length; i++) { double price = rnd.nextdouble() MAX PRICE; double change = price MAX PRICE CHANGE (rnd.nextdouble() 2f 1f); prices[i] = new StockPrice(symbols[i], price, change); return prices; Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 21 Invoking the service from the client Making asynchronous calls to the server import com.google.gwt.user.client.rpc.asynccallback; public interface StockPriceServiceAsync { void getprices(string[] symbols, AsyncCallback<StockPrice[]> callback); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 23 Include the server-side code in the GWT module Define new servlets in the web.xml <web app> <welcome file list> <welcome file>stockwatcher.html</welcome file> </welcome file list> <servlet> <servlet name>stockpriceserviceimpl</servlet name> <servlet class>com.google.gwt.sample.stockwatcher.server. StockPriceServiceImpl</servlet class> </servlet> <servlet mapping> <servlet name>stockpriceserviceimpl</servlet name> <url pattern>/stockwatcher/stockprices</url pattern> </servlet mapping> </web app> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 22 Making the remote procedure call private void refreshwatchlist() { // Initialize the service proxy. if (stockpricesvc == null) { stockpricesvc = GWT.create(StockPriceService.class); // Set up the callback object. AsyncCallback<StockPrice[]> callback = new AsyncCallback< StockPrice[]>() { public void onfailure(throwable caught) { // TODO: Do something with errors. public void onsuccess(stockprice[] result) { updatetable(result); ; // Make the call to the stock price service. stockpricesvc.getprices(stocks.toarray(new String[0]), callback); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 24

7 Serializing Java objects GWT RPC requires that all service method parameters and return types be serializable. import java.io.serializable; JSON public class StockPrice implements Serializable { private String symbol; private double price; private double change;... Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 25 Retrieving JSON Data JSON stands for JavaScript Object Notation Language independant format Very light Example [ { symbol : ABC, price : 87.86, change : 0.41, { symbol : DEF, price : 62.79, change : 0.49 ] Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 27 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 26 Server part JSON can be generated by a servlet out.println( { ); out.print( \ symbol\ : \ ); out.print(stocksymbol); out.println( \, ); out.print( \ price\ : ); out.print(price); out.println(, ); out.print( \ change\ : ); out.println(change); out.println(, ); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 28

8 JSON generated by PHP <?php header( Content Type: text/javascript ); define( MAX PRICE, 100.0); // $ define( MAX PRICE CHANGE, 0.02); // +/ 2% echo [ ; $q = trim($ GET[ q ]); if ($q) { $symbols = explode(, $q); for ($i=0; $i<count($symbols); $i++) { $price = lcg value() MAX PRICE; $change = $price MAX PRICE CHANGE (lcg value() ); echo { ; echo \ symbol\ :\ $symbols[$i]\, ; echo \ price\ :$price, ; echo \ change\ :$change ; echo ; if ($i < (count($symbols) 1)) { echo, ; echo ] ;?> Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 29 Manipulate JSON objects Create a JavaScriptObject StockData to manipulate the data input in Java import com.google.gwt.core.client.javascriptobject; class StockData extends JavaScriptObject { // Overlay types always have protected, zero argument constructors. protected StockData() { // JSNI methods to get stock data. public final native String getsymbol() / { return this.symbol; /; public final native double getprice() / { return this.price; /; public final native double getchange() / { return this.change; /; // Non JSNI method to return change percentage. public final double getchangepercent() { return getchange() / getprice(); Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 31 Transform JSON object into JavaScript use the built in JavaScript function eval The function will receive a response.gettext() as a parameter private final native JsArray<StockData> asarrayofstockdata( String json) / { return eval(json); /; Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 30 Connect the Web server Prepare the list of stocks private void refreshwatchlist() { if (stocks.size() == 0) { return; String url = JSON URL; // Append watch list stock symbols to query URL. Iterator iter = stocks.iterator(); while (iter.hasnext()) { url += iter.next(); if (iter.hasnext()) { url += + ; url = URL.encode(url); // TODO Send request to server and handle errors. Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 32

9 Connect the Web Server (Cont.) Conclusion GWT // Send request to server and catch any errors. RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); try { Request request = builder.sendrequest(null, new RequestCallback() { public void onerror(request request, Throwable exception) { displayerror( Couldn t retrieve JSON ); public void onresponsereceived(request request, Response response ) { if (200 == response.getstatuscode()) { updatetable(asarrayofstockdata(response.gettext())); else { displayerror( Couldn t retrieve JSON ( + response. getstatustext() + ) ); ); catch (RequestException e) { displayerror( Couldn t retrieve JSON ); Google Web Toolkits One Application = one language Development in JavaScript is made easy Client Server Communication is hidden Security Issues Communication is blured What is tested where? Who does what? Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 33 Conclusion AWT Java on a Server Servlet : for small programms (alternative to PHP) Java Server Faces : For large programms with a huge Middle tier Web Security Very important to test and validate inputs Encode outputs Verify everything Do not allow access to your intern kitchen to attackers Remove error messages GWT Only one language from the client to the server Quality Management Can you please fill out the given questionnaire Purely informative, for my use only Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 34 References Google Code overview.html Tutorial for Client Server communication latest/tutorial/clientserver.html Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 35 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 36

Advanced Web Technology 5) Google Web Toolkits - GWT, Client Side

Advanced Web Technology 5) Google Web Toolkits - GWT, Client Side Advanced Web Technology 5) Google Web Toolkits - GWT, Client Side Emmanuel Benoist Spring Term 2018 Berner Fachhochschule Haute école spécialisée bernoise Berne University of Applied Sciences 1 Table of

More information

GWT - RPC COMMUNICATION

GWT - RPC COMMUNICATION GWT - RPC COMMUNICATION http://www.tutorialspoint.com/gwt/gwt_rpc_communication.htm Copyright tutorialspoint.com A GWT based application is generally consists of a client side module and server side module.

More information

Ajax and Web 2.0 Related Frameworks and Toolkits. Dennis Chen Director of Product Engineering / Potix Corporation

Ajax and Web 2.0 Related Frameworks and Toolkits. Dennis Chen Director of Product Engineering / Potix Corporation Ajax and Web 2.0 Related Frameworks and Toolkits Dennis Chen Director of Product Engineering / Potix Corporation dennischen@zkoss.org 1 Agenda Ajax Introduction Access Server Side (Java) API/Data/Service

More information

Google Web Toolkit (GWT)

Google Web Toolkit (GWT) Google Web Toolkit (GWT) What is GWT? GWT is a development toolkit for building and optimizing complex browser-based applications You can develop all code, both client and server in Java (or with a different

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Java Servlets Adv. Web Technologies 1) Servlets (introduction) Emmanuel Benoist Fall Term 2016-17 Introduction HttpServlets Class HttpServletResponse HttpServletRequest Lifecycle Methods Session Handling

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Compiling a C program CS Basics 15) Compiling a C prog. Emmanuel Benoist Fall Term 2016-17 Example of a small program Makefile Define Variables Compilation options Conclusion Berner Fachhochschule Haute

More information

CS Basics 15) Compiling a C prog.

CS Basics 15) Compiling a C prog. CS Basics 15) Compiling a C prog. Emmanuel Benoist Fall Term 2016-17 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Compiling a C program Example of a small

More information

GWT integration with Vaadin. Peter expert & trainer

GWT integration with Vaadin. Peter expert & trainer GWT integration with Vaadin Peter Lehto @peter_lehto expert & trainer Vaadin & GWT GWT Transport mechanisms Web components with Polymer QA Vaadin Connectors Vaadin & GWT Server driven UI framework with

More information

Hacking Web Sites 3) Insecure Direct Object Reference

Hacking Web Sites 3) Insecure Direct Object Reference Hacking Web Sites 3) Insecure Direct Object Reference Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Table of Contents Introduction

More information

Web and Apps 1) HTML - CSS

Web and Apps 1) HTML - CSS Web and Apps 1) HTML - CSS Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 HyperText Markup Language and Cascading Style Sheets

More information

GWT in Action by Robert Hanson and Adam Tacy

GWT in Action by Robert Hanson and Adam Tacy SAMPLE CHAPTER GWT in Action by Robert Hanson and Adam Tacy Chapter 10 Copyright 2007 Manning Publications brief contents PART 1 GETTING STARTED...1 1 Introducing GWT 3 2 Creating the default application

More information

Integrating Seam and GWT

Integrating Seam and GWT Integrating Seam and GWT Integrating the JBoss Seam Framework with the GWT Toolkit : Use cases and patterns Ferda Tartanoglu Neox ia 6563 Who we are 2 > Ferda TARTANOGLU, PhD Consultant and Software Architect

More information

Google Web Toolkit. David Geary. code.google.com/webtoolkit. corewebdeveloper.com

Google Web Toolkit. David Geary. code.google.com/webtoolkit. corewebdeveloper.com Google Web Toolkit code.google.com/webtoolkit David Geary corewebdeveloper.com clarity.training@gmail.com Copyright Clarity Training, Inc. 2009 Code http://coolandusefulgwt.com 2 Copyright Clarity Training,

More information

Simplifying GWT RPC with

Simplifying GWT RPC with 2012 Yaakov Chaikin Simplifying GWT RPC with Open Source GWT-Tools RPC Service (GWT 2.4 Version) Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/gwt.html

More information

7) Malicious File Execution

7) Malicious File Execution 7) Malicious File Execution Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Table of Contents Examples of Attacks Presentation

More information

Google Web Toolkit (GWT) Basics. Sang Shin Java Technology Architect & Evangelist Sun Microsystems, Inc.

Google Web Toolkit (GWT) Basics. Sang Shin Java Technology Architect & Evangelist Sun Microsystems, Inc. Google Web Toolkit (GWT) Basics Sang Shin Java Technology Architect & Evangelist Sun Microsystems, Inc. sang.shin@sun.com www.javapassion.com Disclaimer & Acknowledgments Even though Sang Shin is a full-time

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Table of Contents AWT 4) JSF Lifecycle, Event handling, data binding, i18n Emmanuel Benoist Fall Term 2016-17 Life-cycle Basic JSF Life-cycle Conversion and validation Invoke Application Actors in the

More information

Hacking Web Sites Cross Site Scripting

Hacking Web Sites Cross Site Scripting Hacking Web Sites Cross Site Scripting Emmanuel Benoist Spring Term 2018 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Table of Contents Presentation Stored

More information

Web Programming 4) PHP and the Web

Web Programming 4) PHP and the Web Web Programming 4) PHP and the Web Emmanuel Benoist Fall Term 2013-14 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 PHP a language for Web applications Presentation

More information

Google Web Toolkit (GWT)

Google Web Toolkit (GWT) Google Web Toolkit (GWT) St. Louis Java SIG April 12, 2007 Brad Busch Andrew Prunicki What is GWT? GWT is a much different way to develop web applications from

More information

Developing Web 2.0 Apps with the Google Web Toolkit

Developing Web 2.0 Apps with the Google Web Toolkit Developing Web 2.0 Apps with the Google Web Toolkit Ajax development hurts, and is not recommended without a bottle of analgesics by your side. Luckily for us there are tools that can make developing Web

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Table of Contents Hacking Web Sites Broken Authentication Emmanuel Benoist Spring Term 2018 Introduction Examples of Attacks Brute Force Session Spotting Replay Attack Session Fixation Attack Session Hijacking

More information

Adv. Web Technology 3) Java Server Pages

Adv. Web Technology 3) Java Server Pages Adv. Web Technology 3) Java Server Pages Emmanuel Benoist Fall Term 2016-17 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Presentation of the Course I Introduction

More information

User Interaction: jquery

User Interaction: jquery User Interaction: jquery Assoc. Professor Donald J. Patterson INF 133 Fall 2012 1 jquery A JavaScript Library Cross-browser Free (beer & speech) It supports manipulating HTML elements (DOM) animations

More information

Developing Ajax Web Apps with GWT. Session I

Developing Ajax Web Apps with GWT. Session I Developing Ajax Web Apps with GWT Session I Contents Introduction Traditional Web RIAs Emergence of Ajax Ajax ( GWT ) Google Web Toolkit Installing and Setting up GWT in Eclipse The Project Structure Running

More information

Say goodbye to the pains of Ajax. Yibo

Say goodbye to the pains of Ajax. Yibo Say goodbye to the pains of Ajax Yibo DOM JavaScript XML CSS Standard Browsers: browser-specific dependencies. d Differences Complexity Exprerience: Minesweeper Google Web Toolkit make Ajax development

More information

Berner Fachhochschule Haute école spécialisée bernoise Berne University of Applied Sciences 2

Berner Fachhochschule Haute école spécialisée bernoise Berne University of Applied Sciences 2 Table of Contents 6) Overview: web applications Emmanuel Benoist Spring Term 2018 Presentation Server Side Programming Client Side Frameworks JQuery AngularJS Google Web Toolkit - GWT JSON Conclusion Berner

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

LSI's VMware vcenter Plug-In: A Study in the Use of Open Source Software Erik Johannes Brian Mason LSI Corp

LSI's VMware vcenter Plug-In: A Study in the Use of Open Source Software Erik Johannes Brian Mason LSI Corp LSI's VMware vcenter Plug-In: A Study in the Use of Open Source Software Erik Johannes Brian Mason LSI Corp Goal The goal for the presentation is to share our experience with open source in the hope that

More information

4) PHP and MySQL. Emmanuel Benoist. Spring Term Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1

4) PHP and MySQL. Emmanuel Benoist. Spring Term Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 4) PHP and MySQL Emmanuel Benoist Spring Term 2017 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 PHP and MySQL Introduction Basics of MySQL Create a Table See

More information

GWT: The Technical Advantage. Presenter: Anirudh Dewani Company Name: Google

GWT: The Technical Advantage. Presenter: Anirudh Dewani Company Name: Google GWT: The Technical Advantage Presenter: Anirudh Dewani Company Name: Google What is GWT? 2 How it works Google Web Toolkit Weekly Report 09/01/2008-09/08/200 Code against Java UI libraries 3 How it works

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 The C Programming Language CS Basics 9) C Prog. Lang. Emmanuel Benoist Fall Term 2016-17 Introduction Hello World C Fundamentals Data Types Constants Variables Symbolic Constants Operators and Expressions

More information

The Google Web Toolkit

The Google Web Toolkit The Google Web Toolkit Allen I. Holub Holub Associates www.holub.com allen@holub.com 2010, Allen I. Holub www.holub.com 1 This Talk The point of this talk is to give you an overview of GWT suitable for

More information

welcome to BOILERCAMP HOW TO WEB DEV

welcome to BOILERCAMP HOW TO WEB DEV welcome to BOILERCAMP HOW TO WEB DEV Introduction / Project Overview The Plan Personal Website/Blog Schedule Introduction / Project Overview HTML / CSS Client-side JavaScript Lunch Node.js / Express.js

More information

FINALTERM EXAMINATION Spring 2009 CS506- Web Design and Development Solved by Tahseen Anwar

FINALTERM EXAMINATION Spring 2009 CS506- Web Design and Development Solved by Tahseen Anwar FINALTERM EXAMINATION Spring 2009 CS506- Web Design and Development Solved by Tahseen Anwar www.vuhelp.pk Solved MCQs with reference. inshallah you will found it 100% correct solution. Time: 120 min Marks:

More information

Introduction Haim Michael. All Rights Reserved.

Introduction Haim Michael. All Rights Reserved. Architecture Introduction Applications developed using Vaadin include a web application servlet based part, user interface components, themes that dictate the look & feel and a data model that enables

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Developing a Web Server Platform with SAPI support for AJAX RPC using JSON

Developing a Web Server Platform with SAPI support for AJAX RPC using JSON 94 Developing a Web Server Platform with SAPI support for AJAX RPC using JSON Assist. Iulian ILIE-NEMEDI Informatics in Economy Department, Academy of Economic Studies, Bucharest Writing a custom web server

More information

Hacking Web Sites OWASP Top 10

Hacking Web Sites OWASP Top 10 Hacking Web Sites OWASP Top 10 Emmanuel Benoist Spring Term 2018 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Web Security: Overview of other security risks

More information

E-Nature Tutorial for Google Web Toolkit. Dominik Erbsland

E-Nature Tutorial for Google Web Toolkit. Dominik Erbsland E-Nature Tutorial for Google Web Toolkit Dominik Erbsland (de@profzone.ch) Version 0.1 November 2, 2006 Contents 1 Preface 1 1.1 Why this tutorial............................. 1 2 Creating A Project 2

More information

Django-CSP Documentation

Django-CSP Documentation Django-CSP Documentation Release 3.0 James Socol, Mozilla September 06, 2016 Contents 1 Installing django-csp 3 2 Configuring django-csp 5 2.1 Policy Settings..............................................

More information

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

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2 Control Structures for C CS Basics 10) C Control Structures Emmanuel Benoist Fall Term 2016-17 Data Input and Output Single character In and Output Writing output data Control Statements Branching Looping

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

APIs - what are they, really? Web API, Programming libraries, third party APIs etc

APIs - what are they, really? Web API, Programming libraries, third party APIs etc APIs - what are they, really? Web API, Programming libraries, third party APIs etc Different kinds of APIs Let s consider a Java application. It uses Java interfaces and classes. Classes and interfaces

More information

2 Apache Wink Building Blocks

2 Apache Wink Building Blocks 2 Apache Wink Building Blocks Apache Wink Building Block Basics In order to take full advantage of Apache Wink, a basic understanding of the building blocks that comprise it and their functional integration

More information

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p.

Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p. Preface p. xiii Writing Servlets and JSPs p. 1 Writing a Servlet p. 1 Writing a JSP p. 7 Compiling a Servlet p. 10 Packaging Servlets and JSPs p. 11 Creating the Deployment Descriptor p. 14 Deploying Servlets

More information

Building Rich Internet Applications using Google Web Toolkit

Building Rich Internet Applications using Google Web Toolkit Building Rich Internet Applications using Google Web Toolkit Shiv Kumar Goel 1 & Shikha Singh 2 Asst. Prof, Deputy HOD, Master of Computer Application, VESIT, Mumbai University, India shivkumar.goel@ves.ac.in

More information

Collections and Iterators. Collections

Collections and Iterators. Collections Collections and Iterators Based on the notes from David Fernandez-Baca and Steve Kautz Based on The Java Tutorial (http://docs.oracle.com/javase/tutorial/java/) Bryn Mawr College CS206 Intro to Data Structures

More information

5.1 Registration and Configuration

5.1 Registration and Configuration 5.1 Registration and Configuration Registration and Configuration Apache Wink provides several methods for registering resources and providers. This chapter describes registration methods and Wink configuration

More information

Google Plugin for Eclipse

Google Plugin for Eclipse Google Plugin for Eclipse Not just for newbies anymore Miguel Mendez Tech Lead - Google Plugin for Eclipse 1 Overview Background AJAX Google Web Toolkit (GWT) App Engine for Java Plugin Design Principles

More information

Some Facts Web 2.0/Ajax Security

Some Facts Web 2.0/Ajax Security /publications/notes_and_slides Some Facts Web 2.0/Ajax Security Allen I. Holub Holub Associates allen@holub.com Hackers attack bugs. The more complex the system, the more bugs it will have. The entire

More information

5.4. Events and notifications

5.4. Events and notifications 5.4. Events and notifications Distributed event-based systems extend local event model Allowing multiple objects at diff. locations to be notified of events taking place at an object Two characteristics:

More information

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies CNIT 129S: Securing Web Applications Ch 3: Web Application Technologies HTTP Hypertext Transfer Protocol (HTTP) Connectionless protocol Client sends an HTTP request to a Web server Gets an HTTP response

More information

PROCE55 Mobile: Web API App. Web API. https://www.rijksmuseum.nl/api/...

PROCE55 Mobile: Web API App. Web API. https://www.rijksmuseum.nl/api/... PROCE55 Mobile: Web API App PROCE55 Mobile with Test Web API App Web API App Example This example shows how to access a typical Web API using your mobile phone via Internet. The returned data is in JSON

More information

Fast, Easy, Beautiful: Pick Three Building User Interfaces with Google Web Toolkit. Chris Schalk October 29, 2007

Fast, Easy, Beautiful: Pick Three Building User Interfaces with Google Web Toolkit. Chris Schalk October 29, 2007 Fast, Easy, Beautiful: Pick Three Building User Interfaces with Google Web Toolkit Chris Schalk October 29, 2007 Today s Topics The potential of Ajax - why we re all here GWT brings software engineering

More information

1 Introduction. 2 Web Architecture

1 Introduction. 2 Web Architecture 1 Introduction This document serves two purposes. The first section provides a high level overview of how the different pieces of technology in web applications relate to each other, and how they relate

More information

Cross-Platform Data Models and API Using grpc

Cross-Platform Data Models and API Using grpc Cross-Platform Data Models and API Using grpc Sebastian Hagedorn, Felix Lamouroux Outline 1. Motivation & Goals 2. Choosing the Right Cross-Platform Technology 3. Introduction to Protocol Buffers and grpc

More information

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A Contents Java RMI G53ACC Chris Greenhalgh Java RMI overview A Java RMI example Overview Walk-through Implementation notes Argument passing File requirements RPC issues and RMI Other problems with RMI 1

More information

Brief Summary of Java

Brief Summary of Java Brief Summary of Java Java programs are compiled into an intermediate format, known as bytecode, and then run through an interpreter that executes in a Java Virtual Machine (JVM). The basic syntax of Java

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws

Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws Lecture 14 Summary Exceptions vs. Errors Exceptions vs. RuntimeExceptions try...catch...finally throw and throws 1 By the end of this lecture, you will be able to differentiate between errors, exceptions,

More information

widgets, events, layout loosely similar to Swing test browser, or plugin for testing with real browser on local system

widgets, events, layout loosely similar to Swing test browser, or plugin for testing with real browser on local system Web [Application] Frameworks conventional approach to building a web service write ad hoc client code in HTML, CSS, Javascript,... by hand write ad hoc server code in [whatever] by hand write ad hoc access

More information

GWT - INTERNATIONALIZATION

GWT - INTERNATIONALIZATION GWT - INTERNATIONALIZATION http://www.tutorialspoint.com/gwt/gwt_internationalization.htm Copyright tutorialspoint.com GWT provides three ways to internationalize a GWT application, We'll demonstrate use

More information

CS Basics 14) C: Additional features

CS Basics 14) C: Additional features CS Basics 14) C: Additional features Emmanuel Benoist Fall Term 2016-17 Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 1 Additional Features of C Enumerations

More information

Advanced Java Programming

Advanced Java Programming Advanced Java Programming Length: 4 days Description: This course presents several advanced topics of the Java programming language, including Servlets, Object Serialization and Enterprise JavaBeans. In

More information

Taming AJAX with GWT. Scott Blum. Scott Blum Taming AJAX with GWT Page 1

Taming AJAX with GWT. Scott Blum. Scott Blum Taming AJAX with GWT Page 1 Taming AJAX with GWT Scott Blum Scott Blum Taming AJAX with GWT Page 1 Overview Why AJAX? Why GWT? How GWT Works Add GWT to your App Advanced Techniques Summary Q & A Scott Blum Taming AJAX with GWT Page

More information

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Advanced Web Technology 10) XSS, CSRF and SQL Injection Berner Fachhochschule, Technik und Informatik Advanced Web Technology 10) XSS, CSRF and SQL Injection Dr. E. Benoist Fall Semester 2010/2011 1 Table of Contents Cross Site Request Forgery - CSRF Presentation

More information

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum Ajax The notion of asynchronous request processing using the XMLHttpRequest object has been around for several years, but the term "AJAX" was coined by Jesse James Garrett of Adaptive Path. You can read

More information

CHAPTER 7 OBJECTS AND CLASSES

CHAPTER 7 OBJECTS AND CLASSES CHAPTER 7 OBJECTS AND CLASSES OBJECTIVES After completing Objects and Classes, you will be able to: Explain the use of classes in Java for representing structured data. Distinguish between objects and

More information

The ArrayList class CSC 123 Fall 2018 Howard Rosenthal

The ArrayList class CSC 123 Fall 2018 Howard Rosenthal The ArrayList class CSC 123 Fall 2018 Howard Rosenthal Lesson Goals Describe the ArrayList class Discuss important methods of this class Describe how it can be used in modeling Much of the information

More information

Voyager Interoperability Guide Version 1.1 for Voyager 8.0

Voyager Interoperability Guide Version 1.1 for Voyager 8.0 Voyager Interoperability Guide Version 1.1 for Voyager 8.0 Table of Contents Introduction... 3 Audience... 3 Prerequisites... 3 Overview... 3 Contacting Technical Support... 3 The Distributed Data Model...

More information

So far, Wednesday, February 03, :47 PM. So far,

So far, Wednesday, February 03, :47 PM. So far, Binding_and_Refinement Page 1 So far, 3:47 PM So far, We've created a simple persistence project with cloud references. There were lots of relationships between entities that must be fulfilled. How do

More information

generates scaffolding/framework for models, views

generates scaffolding/framework for models, views Django by Adrian Holovaty and Jacob Kaplan-Moss (released July 2005) a collection of Python scripts to create a new project / site generates Python scripts for settings, etc. configuration info stored

More information

DESIGN AND IMPLEMENTATION OF SAGE DISPLAY CONTROLLER PROJECT

DESIGN AND IMPLEMENTATION OF SAGE DISPLAY CONTROLLER PROJECT DESIGN AND IMPLEMENTATION OF SAGE DISPLAY CONTROLLER BY Javid M. Alimohideen Meerasa M.S., University of Illinois at Chicago, 2003 PROJECT Submitted as partial fulfillment of the requirements for the degree

More information

Windows and Events. created originally by Brian Bailey

Windows and Events. created originally by Brian Bailey Windows and Events created originally by Brian Bailey Announcements Review next time Midterm next Friday UI Architecture Applications UI Builders and Runtimes Frameworks Toolkits Windowing System Operating

More information

Getting Started With Feature Toggle in Java

Getting Started With Feature Toggle in Java Guide Getting Started With Feature Toggle in Java INTRO Feature toggles (also known as feature flags) are simple. You want to introduce new behavior in a Java application, but you re not ready to turn

More information

Compaq Interview Questions And Answers

Compaq Interview Questions And Answers Part A: Q1. What are the difference between java and C++? Java adopts byte code whereas C++ does not C++ supports destructor whereas java does not support. Multiple inheritance possible in C++ but not

More information

Web Architecture and Development

Web Architecture and Development Web Architecture and Development SWEN-261 Introduction to Software Engineering Department of Software Engineering Rochester Institute of Technology HTTP is the protocol of the world-wide-web. The Hypertext

More information

Google Web Toolkit for quick relief of AJAX pain. Kelly Norton & Miguel Méndez

Google Web Toolkit for quick relief of AJAX pain. Kelly Norton & Miguel Méndez Google Web Toolkit for quick relief of AJAX pain. Kelly Norton & Miguel Méndez Overview the pleasure of using AJAX apps. the pain of creating them. getting some pain relief with GWT. the tutorial part.

More information

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

SSC - Web applications and development Introduction and Java Servlet (I) SSC - Web applications and development Introduction and Java Servlet (I) Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics What will we learn

More information

CSC309: Introduction to Web Programming. Lecture 11

CSC309: Introduction to Web Programming. Lecture 11 CSC309: Introduction to Web Programming Lecture 11 Wael Aboulsaadat Servlets+JSP Model 2 Architecture 2 Servlets+JSP Model 2 Architecture = MVC Design Pattern 3 Servlets+JSP Model 2 Architecture Controller

More information

Lecture 14 Summary 3/9/2009. By the end of this lecture, you will be able to differentiate between errors, exceptions, and runtime exceptions.

Lecture 14 Summary 3/9/2009. By the end of this lecture, you will be able to differentiate between errors, exceptions, and runtime exceptions. Lecture 14 Summary Exceptions vs. Errors Exceptions vs. RuntimeExceptions...catch...finally throw and throws By the end of this lecture, you will be able to differentiate between errors, exceptions, and

More information

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS Chapter 1 : Chapter-wise Java Multiple Choice Questions and Answers Interview MCQs Java Programming questions and answers with explanation for interview, competitive examination and entrance test. Fully

More information

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2) Introduction Objective To support interoperability and portability of distributed OO applications by provision of enabling technology Object interaction vs RPC Java Remote Method Invocation (RMI) RMI Registry

More information

Web Programming. Lecture 11. University of Toronto

Web Programming. Lecture 11. University of Toronto CSC309: Introduction to Web Programming Lecture 11 Wael Aboulsaadat University of Toronto Servlets+JSP Model 2 Architecture University of Toronto 2 Servlets+JSP Model 2 Architecture = MVC Design Pattern

More information

CS 498RK FALL RESTFUL APIs

CS 498RK FALL RESTFUL APIs CS 498RK FALL 2017 RESTFUL APIs Designing Restful Apis blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/ www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api Resources

More information

RESTful SCA with Apache Tuscany

RESTful SCA with Apache Tuscany RESTful SCA with Apache Tuscany Luciano Resende lresende@apache.org http://lresende.blogspot.com Jean-Sebastien Delfino jsdelfino@apache.org http://jsdelfino.blogspot.com 1 Agenda IBM Software Group What

More information

CSCE 120: Learning To Code

CSCE 120: Learning To Code CSCE 120: Learning To Code Module 11.0: Consuming Data I Introduction to Ajax This module is designed to familiarize you with web services and web APIs and how to connect to such services and consume and

More information

INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION. Instructors: Crista Lopes Copyright Instructors.

INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION. Instructors: Crista Lopes Copyright Instructors. INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION Instructors: Crista Lopes Copyright Instructors. Topics Recursion Higher-order functions Continuation-Passing Style Monads (take 1) Identity Monad Maybe

More information

Background. Reflection. The Class Class. How Objects Work

Background. Reflection. The Class Class. How Objects Work Background Reflection Turing's great insight: programs are just another kind of data Source code is text Manipulate it line by line, or by parsing expressions Compiled programs are data, too Integers and

More information

Pimp My Webapp (with Google Web Toolkit)

Pimp My Webapp (with Google Web Toolkit) (with Google Web Toolkit) Hermod Opstvedt Chief Architect DnB NOR ITUD Common components Hermod Opstvedt (with Google Web Toolkit) Slide 1 What is Google Web Toolkit (GWT)? Pronounced GWiT. An effort to

More information

Introduce C# as Object Oriented programming language. Explain, tokens,

Introduce C# as Object Oriented programming language. Explain, tokens, Module 2 98 Assignment 1 Introduce C# as Object Oriented programming language. Explain, tokens, lexicals and control flow constructs. 99 The C# Family Tree C Platform Independence C++ Object Orientation

More information

STARCOUNTER. Technical Overview

STARCOUNTER. Technical Overview STARCOUNTER Technical Overview Summary 3 Introduction 4 Scope 5 Audience 5 Prerequisite Knowledge 5 Virtual Machine Database Management System 6 Weaver 7 Shared Memory 8 Atomicity 8 Consistency 9 Isolation

More information

Java SE7 Fundamentals

Java SE7 Fundamentals Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various

More information

Google Web Toolkit. Can help you create amazing apps. San Francisco Java User Group Oct 13, 2009

Google Web Toolkit. Can help you create amazing apps. San Francisco Java User Group Oct 13, 2009 Google Web Toolkit Can help you create amazing apps San Francisco Java User Group Oct 13, 2009 Fred Sauer Developer Advocate fredsa@google.com Twitter: @fredsa 1 Agenda Introduction Selecting a language

More information

Accelerated GWT. Building Enterprise Google Web Toolkit Applications. Vipul Gupta

Accelerated GWT. Building Enterprise Google Web Toolkit Applications. Vipul Gupta Accelerated GWT Building Enterprise Google Web Toolkit Applications Vipul Gupta Accelerated GWT: Building Enterprise Google Web Toolkit Applications Copyright 2008 by Vipul Gupta All rights reserved. No

More information

JAVA MOCK TEST JAVA MOCK TEST IV

JAVA MOCK TEST JAVA MOCK TEST IV http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

AJAX Programming Chris Seddon

AJAX Programming Chris Seddon AJAX Programming Chris Seddon seddon-software@keme.co.uk 2000-12 CRS Enterprises Ltd 1 2000-12 CRS Enterprises Ltd 2 What is Ajax? "Asynchronous JavaScript and XML" Originally described in 2005 by Jesse

More information

Java for Non Majors. Final Study Guide. April 26, You will have an opportunity to earn 20 extra credit points.

Java for Non Majors. Final Study Guide. April 26, You will have an opportunity to earn 20 extra credit points. Java for Non Majors Final Study Guide April 26, 2017 The test consists of 1. Multiple choice questions 2. Given code, find the output 3. Code writing questions 4. Code debugging question 5. Short answer

More information

Web Architecture AN OVERVIEW

Web Architecture AN OVERVIEW Web Architecture AN OVERVIEW General web architecture Historically, the client is a web browser But it can be also A mobile application A desktop application Other server applications Internet Server(s)

More information