Ajax is the web's hottest user interface. Struts is Java's most popular web framework. What happens when we put Ajax on Struts?
In this session, we look at writing a new Struts 2 application from square one, using the Yahoo User Interface (YUI) Library on the front end, and Struts 2 on the backend. YUI provides the glitz and the glamour, and Struts 2 provides the dreary business logic, input validation, and text formatting.
During the session, we will cover
* How to integrate an Ajax UI with Struts 2
* Basics of the Yahoo User Interface (YUI) Library
* Business services Struts can provide to an Ajax UI
Who should attend: Ajax developers who would like to utilize Struts as a back-end, and Struts developers who would like to utilize Ajax as a front-end.
To get the most from this session, some familiarity with an Ajax library, like YUI or Dojo, is helpful.
Lets look at writing a new Struts 2 application from square one, using the Yahoo User Interface (YUI) Library on the front end, and Struts 2 on the backend. YUI provides the glitz and the glamour, and Struts 2 provides the dreary business logic, input validation, and text formatting.
Lets stir some Ajax wizardry into a conventional Struts application, without all the sweat and bother of writing our own JavaScript. Struts 1 and Struts 2 both support Ajax taglibs that look and feel just like ordinary JSP tags. If it's just a little bit of Ajax that you want, these tags will get you around the learning curve in record time.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
WebGL and COLLADA were discussed as technologies for 3D rendering and asset interchange on the web. The presentation covered the history and capabilities of both standards. It also described approaches for loading COLLADA assets into WebGL, such as preprocessing COLLADA into JSON or loading XML directly and parsing it with JavaScript. Optimizing COLLADA assets for WebGL rendering through techniques like quantization and compression was also mentioned.
This document provides an overview of JavaScript reversing techniques. It discusses JavaScript technologies like the DOM, Ajax, and JSON. It covers security aspects like the same-origin policy. It provides tips for analyzing JavaScript using tools like Firebug. It also demonstrates finding vulnerabilities like DOM-based XSS and reversing obfuscated JavaScript.
At Samsara, we use GraphQL to rapidly build new features. Samsara's platform has many moving pieces: gateways and sensors in the field, data processing backends, and our web and mobile applications. To keep things sane, we use static typing everywhere: Protobufs, Go, GraphQL, and TypeScript. In this talk we'll discuss how we use Thunder, our Go GraphQL server, apollo-codegen, and other tools to automatically glue these pieces together and make development easier with close to zero developer effort.
Xcore is a textual format to define ecore models. This not only makes editing and reading much more convenient but has other cool advantages as well. Xcore, for instance, allows to embed Xbase expressions to define logic within EOperations and the like.
In this session you will learn, why and when using Xcore is a good idea and how to use it with Xtext languages. I will explain talk about which URIs to use, and how to properly configure the MWE2 file as well as more complicated setups, with multiple languages and mixtures of ecore, xcore and generated models.
Lets look at writing a new Struts 2 application from square one, using the Yahoo User Interface (YUI) Library on the front end, and Struts 2 on the backend. YUI provides the glitz and the glamour, and Struts 2 provides the dreary business logic, input validation, and text formatting.
Lets stir some Ajax wizardry into a conventional Struts application, without all the sweat and bother of writing our own JavaScript. Struts 1 and Struts 2 both support Ajax taglibs that look and feel just like ordinary JSP tags. If it's just a little bit of Ajax that you want, these tags will get you around the learning curve in record time.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
WebGL and COLLADA were discussed as technologies for 3D rendering and asset interchange on the web. The presentation covered the history and capabilities of both standards. It also described approaches for loading COLLADA assets into WebGL, such as preprocessing COLLADA into JSON or loading XML directly and parsing it with JavaScript. Optimizing COLLADA assets for WebGL rendering through techniques like quantization and compression was also mentioned.
This document provides an overview of JavaScript reversing techniques. It discusses JavaScript technologies like the DOM, Ajax, and JSON. It covers security aspects like the same-origin policy. It provides tips for analyzing JavaScript using tools like Firebug. It also demonstrates finding vulnerabilities like DOM-based XSS and reversing obfuscated JavaScript.
At Samsara, we use GraphQL to rapidly build new features. Samsara's platform has many moving pieces: gateways and sensors in the field, data processing backends, and our web and mobile applications. To keep things sane, we use static typing everywhere: Protobufs, Go, GraphQL, and TypeScript. In this talk we'll discuss how we use Thunder, our Go GraphQL server, apollo-codegen, and other tools to automatically glue these pieces together and make development easier with close to zero developer effort.
Xcore is a textual format to define ecore models. This not only makes editing and reading much more convenient but has other cool advantages as well. Xcore, for instance, allows to embed Xbase expressions to define logic within EOperations and the like.
In this session you will learn, why and when using Xcore is a good idea and how to use it with Xtext languages. I will explain talk about which URIs to use, and how to properly configure the MWE2 file as well as more complicated setups, with multiple languages and mixtures of ecore, xcore and generated models.
GreenDAO is an ORM (Object Relational Mapping) library that uses code generation to provide a faster alternative to reflection-based ORMs for Android. It works by mapping Java objects to SQLite database tables to allow for CRUD (create, read, update, delete) operations on the data. The library includes a schema definition and code generator that automatically generates DAO classes to manage database access and queries. This avoids the performance overhead of reflection and allows for compiler checks of the database schema.
GreenDao is an ORM library that provides high performance for CRUD operations on SQLite databases in Android apps. It uses code generation to map objects to database tables, allowing data to be accessed and queried using objects rather than raw SQL. Some key features include object mapping, query building, caching, and bulk operations. The documentation provides examples of how to set up GreenDao in a project, define entity classes, perform queries, inserts, updates and deletes on objects.
This document discusses the Ajaxian framework Prototype and its utilities for asynchronous JavaScript (Ajax). It provides an overview of Prototype's basic utilities for DOM manipulation and Ajax helpers. The Ajax helpers include an Ajax object that handles cross-browser XMLHttpRequests and an Ajax.Request method for making Ajax calls with configurable options and callbacks. An example is given showing how to make an Ajax request and specify a callback function using Ajax.Request.
Xtext Grammar Language describes how to define grammars for the Xtext language development framework. Key points include:
- Grammars define the structure and elements of a language through rules like Statemachine, Event, and Transition.
- Terminals split text into tokens while hidden terminals are ignored by the parser. Datatype rules return values instead of objects.
- The parser creates EObjects when rules assign to the current pointer. Actions ensure object creation when no assignment occurs.
- Issues like ambiguities, left recursion, and left factoring can be resolved through techniques like keywords, predicates, and assigned actions.
- The grammar maps language structures to Ecore classes and features through rule return types
This document discusses how to use GreenDAO, an ORM library for Android, to generate code for database operations. It explains how to create a database schema, generate DAO files, perform CRUD operations like insert, query, and join data from multiple tables. GreenDAO allows mapping Java objects to database tables, provides an API to write queries using query builders, and handles database operations asynchronously on background threads.
greenDAO is an ORM (object relational mapping) library that uses code generation to provide a higher level API for SQLite databases on Android. It generates Java classes from an entity model that allows reading and writing objects to the database instead of using raw SQL. This improves productivity by handling common database tasks like queries and transactions. The generated code avoids reflection for better performance compared to annotation-based ORMs. The library focuses on optimization through techniques like custom cursors, entity caching, and bulk operations to achieve high performance suitable for Android.
This document discusses the history and evolution of ECMAScript, also known as JavaScript. It begins with the origins of JavaScript in the mid-1990s and traces the development of the language through successive standards known as ECMAScript 3, 5, 6 and beyond. Key features of newer ECMAScript versions like ECMAScript 6 are summarized, including let and const block scoping, shorthand object literal syntax, default parameters, rest parameters, spread syntax, classes, modules, destructuring and iterators. The presentation aims to explain new JavaScript capabilities and show code examples.
Good and Bad Code
The Broken Window Theory
The Grand Redesign in the Sky
The Sushi Chef Rule
The Hotel Room Rule
The Boy Scout Rule
OOP Patterns and Principles
SOLID Principles
How to measure clean code?
Tools
Getting started with Elasticsearch and .NETTomas Jansson
This document provides an introduction to using Elasticsearch with .NET and the NEST client library. It demonstrates how to install and configure Elasticsearch on Windows, define mappings and index documents using NEST, perform various queries including fuzzy, highlighted, faceted queries, and add filters. NEST provides a strongly typed, fluent abstraction over Elasticsearch that allows querying and filtering Elasticsearch in a similar manner to Elasticsearch JSON queries. The document encourages attendees to view the demo code on GitHub for examples of indexing, querying, highlighting, faceting, and filtering documents using NEST.
The document discusses XML and methods for working with XML nodes in .NET. It provides an example of programmatically creating an XML node by first creating element, attribute, and document objects, appending the attribute to the element, appending the element to the root node, and saving the XML file. It also shows how to select and retrieve values from existing XML nodes to populate object properties.
JavaScript is a client-side scripting language that adds interactivity to HTML pages. It can be embedded in HTML using <script> tags and scripts can be placed internally in the HTML file or externally in a .js file. JavaScript code can be inserted in the <head> or <body> sections, but is typically placed at the end of the <body> for faster page loads. Core JavaScript concepts include variables, objects, functions, operators, conditions, loops, and arrays. The DOM (Document Object Model) allows JavaScript to access and modify HTML elements on the page and events can be used to trigger JavaScript functions in response to user actions.
This document provides an overview of Slick, a library for Scala that facilitates database access and querying. It discusses key Slick concepts like the lifted and direct query APIs, supported databases, and features like being easy, concise, safe, composable and explicit. It also covers topics like database schemas, queries for data definition, manipulation, filtering, sorting, joins and unions. Live code examples are provided throughout to demonstrate how to connect to a database, define schemas, and write various query types in Slick.
Andy introduces ORMLite, an ORM library for Android. He demonstrates how to define data models with annotations, create database helpers to manage the underlying SQLite database, and implement DAO classes to perform CRUD operations and transactions on the data models. The code examples show how to define one-to-many relationships between User and Group data tables, and use the ORMLite API to easily insert, query, update, and delete records while handling transactions and relationships between the tables.
This document discusses automatically generating JSON from Java objects using the org.json Java utilities. It begins with an introduction and setup information for using the utilities. It then covers the general approach of setting headers, getting data from business logic, and turning Java objects into JSONObjects or JSONArrays. Examples are provided of turning a Java bean into a JSONObject and building a JSONArray from a list of beans. The benefits and limitations of automatically generating JSON are compared to manually building JSON on the server.
Reducing Development Time with MongoDB vs. SQLMongoDB
Buzz Moschetti compares the development time and effort required to save and fetch contact data using MongoDB versus SQL over the course of two weeks. With SQL, each time a new field is added or the data structure changes, the SQL schema must be altered and code updated in multiple places. With MongoDB, the data structure can evolve freely without changes to the data access code - it remains a simple insert and find. By day 14, representing the more complex data structure in SQL would require flattening some data and storing it in non-ideal ways, while MongoDB continues to require no changes to the simple data access code.
Objects in JavaScript can be created using object literals, the new keyword, or Object.create(). Objects are collections of properties and methods that are mutable and manipulated by reference. Arrays are objects that represent ordered collections of values of any type and are created using array literals or the Array constructor. Common array methods include concat, join, pop, push, reverse, and sort. The Math object provides common mathematical functions like pow, round, ceil, floor, random, and trigonometric functions.
Objective-C Crash Course for Web DevelopersJoris Verbogt
These are the slides of my SXSW 2010 Objective-C Crash Course for Web Developers.
The code samples (and the keynote document) can also be downloaded from http://workshop.verbogt.nl/
Introduction to Active Record - Silicon Valley Ruby Conference 2007Rabble .
Active Record is an object-relational mapping (ORM) pattern that allows developers to interact with a database using objects rather than SQL queries. It establishes a direct association between classes and database tables, and between class objects and table rows. The key characteristics of Active Record include directly mapping classes to tables, objects to rows, and using finders and setters to encapsulate data access. The Ruby on Rails framework includes an implementation of Active Record to provide data modeling and database access functions.
1. The document discusses using Ajax to return JavaScript code and objects from a server. Code examples are provided to return a JavaScript function from a PHP file using XMLHttpRequest, and to convert text into a JavaScript object.
2. Methods for using the XMLHttpRequest HEAD method are demonstrated to retrieve header information from the server, such as the server name, date/time, and file modification date.
3. The code is modified to extract only the last modified date from the header, and then further modified to display individual parts of the date like date, month, year, hours, minutes, and seconds.
4. An example is given to check if a URL exists using HEAD requests and XMLHttpRequest.
The document describes how to use Ajax techniques to fetch data from a text file and display it on a web page without refreshing the page. It includes:
1) An HTML file with a button that, when clicked, calls a JavaScript function to fetch the data.
2) The JavaScript function uses the XMLHttpRequest object to make an asynchronous GET request to the text file and display the response in a <div> element.
3) It analyzes how the XMLHttpRequest object is used to open a connection, handle the response, and display the fetched data on the page without reloading.
GreenDAO is an ORM (Object Relational Mapping) library that uses code generation to provide a faster alternative to reflection-based ORMs for Android. It works by mapping Java objects to SQLite database tables to allow for CRUD (create, read, update, delete) operations on the data. The library includes a schema definition and code generator that automatically generates DAO classes to manage database access and queries. This avoids the performance overhead of reflection and allows for compiler checks of the database schema.
GreenDao is an ORM library that provides high performance for CRUD operations on SQLite databases in Android apps. It uses code generation to map objects to database tables, allowing data to be accessed and queried using objects rather than raw SQL. Some key features include object mapping, query building, caching, and bulk operations. The documentation provides examples of how to set up GreenDao in a project, define entity classes, perform queries, inserts, updates and deletes on objects.
This document discusses the Ajaxian framework Prototype and its utilities for asynchronous JavaScript (Ajax). It provides an overview of Prototype's basic utilities for DOM manipulation and Ajax helpers. The Ajax helpers include an Ajax object that handles cross-browser XMLHttpRequests and an Ajax.Request method for making Ajax calls with configurable options and callbacks. An example is given showing how to make an Ajax request and specify a callback function using Ajax.Request.
Xtext Grammar Language describes how to define grammars for the Xtext language development framework. Key points include:
- Grammars define the structure and elements of a language through rules like Statemachine, Event, and Transition.
- Terminals split text into tokens while hidden terminals are ignored by the parser. Datatype rules return values instead of objects.
- The parser creates EObjects when rules assign to the current pointer. Actions ensure object creation when no assignment occurs.
- Issues like ambiguities, left recursion, and left factoring can be resolved through techniques like keywords, predicates, and assigned actions.
- The grammar maps language structures to Ecore classes and features through rule return types
This document discusses how to use GreenDAO, an ORM library for Android, to generate code for database operations. It explains how to create a database schema, generate DAO files, perform CRUD operations like insert, query, and join data from multiple tables. GreenDAO allows mapping Java objects to database tables, provides an API to write queries using query builders, and handles database operations asynchronously on background threads.
greenDAO is an ORM (object relational mapping) library that uses code generation to provide a higher level API for SQLite databases on Android. It generates Java classes from an entity model that allows reading and writing objects to the database instead of using raw SQL. This improves productivity by handling common database tasks like queries and transactions. The generated code avoids reflection for better performance compared to annotation-based ORMs. The library focuses on optimization through techniques like custom cursors, entity caching, and bulk operations to achieve high performance suitable for Android.
This document discusses the history and evolution of ECMAScript, also known as JavaScript. It begins with the origins of JavaScript in the mid-1990s and traces the development of the language through successive standards known as ECMAScript 3, 5, 6 and beyond. Key features of newer ECMAScript versions like ECMAScript 6 are summarized, including let and const block scoping, shorthand object literal syntax, default parameters, rest parameters, spread syntax, classes, modules, destructuring and iterators. The presentation aims to explain new JavaScript capabilities and show code examples.
Good and Bad Code
The Broken Window Theory
The Grand Redesign in the Sky
The Sushi Chef Rule
The Hotel Room Rule
The Boy Scout Rule
OOP Patterns and Principles
SOLID Principles
How to measure clean code?
Tools
Getting started with Elasticsearch and .NETTomas Jansson
This document provides an introduction to using Elasticsearch with .NET and the NEST client library. It demonstrates how to install and configure Elasticsearch on Windows, define mappings and index documents using NEST, perform various queries including fuzzy, highlighted, faceted queries, and add filters. NEST provides a strongly typed, fluent abstraction over Elasticsearch that allows querying and filtering Elasticsearch in a similar manner to Elasticsearch JSON queries. The document encourages attendees to view the demo code on GitHub for examples of indexing, querying, highlighting, faceting, and filtering documents using NEST.
The document discusses XML and methods for working with XML nodes in .NET. It provides an example of programmatically creating an XML node by first creating element, attribute, and document objects, appending the attribute to the element, appending the element to the root node, and saving the XML file. It also shows how to select and retrieve values from existing XML nodes to populate object properties.
JavaScript is a client-side scripting language that adds interactivity to HTML pages. It can be embedded in HTML using <script> tags and scripts can be placed internally in the HTML file or externally in a .js file. JavaScript code can be inserted in the <head> or <body> sections, but is typically placed at the end of the <body> for faster page loads. Core JavaScript concepts include variables, objects, functions, operators, conditions, loops, and arrays. The DOM (Document Object Model) allows JavaScript to access and modify HTML elements on the page and events can be used to trigger JavaScript functions in response to user actions.
This document provides an overview of Slick, a library for Scala that facilitates database access and querying. It discusses key Slick concepts like the lifted and direct query APIs, supported databases, and features like being easy, concise, safe, composable and explicit. It also covers topics like database schemas, queries for data definition, manipulation, filtering, sorting, joins and unions. Live code examples are provided throughout to demonstrate how to connect to a database, define schemas, and write various query types in Slick.
Andy introduces ORMLite, an ORM library for Android. He demonstrates how to define data models with annotations, create database helpers to manage the underlying SQLite database, and implement DAO classes to perform CRUD operations and transactions on the data models. The code examples show how to define one-to-many relationships between User and Group data tables, and use the ORMLite API to easily insert, query, update, and delete records while handling transactions and relationships between the tables.
This document discusses automatically generating JSON from Java objects using the org.json Java utilities. It begins with an introduction and setup information for using the utilities. It then covers the general approach of setting headers, getting data from business logic, and turning Java objects into JSONObjects or JSONArrays. Examples are provided of turning a Java bean into a JSONObject and building a JSONArray from a list of beans. The benefits and limitations of automatically generating JSON are compared to manually building JSON on the server.
Reducing Development Time with MongoDB vs. SQLMongoDB
Buzz Moschetti compares the development time and effort required to save and fetch contact data using MongoDB versus SQL over the course of two weeks. With SQL, each time a new field is added or the data structure changes, the SQL schema must be altered and code updated in multiple places. With MongoDB, the data structure can evolve freely without changes to the data access code - it remains a simple insert and find. By day 14, representing the more complex data structure in SQL would require flattening some data and storing it in non-ideal ways, while MongoDB continues to require no changes to the simple data access code.
Objects in JavaScript can be created using object literals, the new keyword, or Object.create(). Objects are collections of properties and methods that are mutable and manipulated by reference. Arrays are objects that represent ordered collections of values of any type and are created using array literals or the Array constructor. Common array methods include concat, join, pop, push, reverse, and sort. The Math object provides common mathematical functions like pow, round, ceil, floor, random, and trigonometric functions.
Objective-C Crash Course for Web DevelopersJoris Verbogt
These are the slides of my SXSW 2010 Objective-C Crash Course for Web Developers.
The code samples (and the keynote document) can also be downloaded from http://workshop.verbogt.nl/
Introduction to Active Record - Silicon Valley Ruby Conference 2007Rabble .
Active Record is an object-relational mapping (ORM) pattern that allows developers to interact with a database using objects rather than SQL queries. It establishes a direct association between classes and database tables, and between class objects and table rows. The key characteristics of Active Record include directly mapping classes to tables, objects to rows, and using finders and setters to encapsulate data access. The Ruby on Rails framework includes an implementation of Active Record to provide data modeling and database access functions.
1. The document discusses using Ajax to return JavaScript code and objects from a server. Code examples are provided to return a JavaScript function from a PHP file using XMLHttpRequest, and to convert text into a JavaScript object.
2. Methods for using the XMLHttpRequest HEAD method are demonstrated to retrieve header information from the server, such as the server name, date/time, and file modification date.
3. The code is modified to extract only the last modified date from the header, and then further modified to display individual parts of the date like date, month, year, hours, minutes, and seconds.
4. An example is given to check if a URL exists using HEAD requests and XMLHttpRequest.
The document describes how to use Ajax techniques to fetch data from a text file and display it on a web page without refreshing the page. It includes:
1) An HTML file with a button that, when clicked, calls a JavaScript function to fetch the data.
2) The JavaScript function uses the XMLHttpRequest object to make an asynchronous GET request to the text file and display the response in a <div> element.
3) It analyzes how the XMLHttpRequest object is used to open a connection, handle the response, and display the fetched data on the page without reloading.
The document describes code for an Ajax program that fetches data from a text file without refreshing the page. It includes:
1. HTML with a button to call the getData() function, which makes an AJAX request and displays the response in a <div>.
2. JavaScript code to create an XMLHttpRequest object and define the getData() function. This function opens a GET request, defines an onreadystatechange handler to process the response, and sends the request.
3. An analysis of the code, explaining how it works step-by-step, including creating the XMLHttpRequest object, making the asynchronous request, and updating the HTML with the response text.
Introduction to programming with Ajax. Covers XMLHttpRequest, XML, JSON, JavaScript, HTML, CSS, Dom Scripting, Event Handling with some examples from YUI library. I gave this talk a dozen or more times in workshops throughout the U.S. & in Amsterdam (AdaptivePath, Yahoo!, Federal Reserve, Ultimate Software, VeriSign, United Online, etc.) . Jan 2006 - Feb 2007.
Ajax allows asynchronous retrieval of data from a server without page refreshes. It uses the XMLHttpRequest object in JavaScript to communicate with servers in the background. This allows parts of a web page to be updated without reloading the entire page. Ajax is commonly used for autocomplete, live searches, chatting applications, and updating content like news articles or maps without full page loads. It provides a more interactive and responsive experience for users.
The DOM (Document Object Model) allows programs and scripts to dynamically access and update the content, structure and style of documents. It gives generic access to elements, styles and attributes in a document. The DOM organizes how elements are referenced and interact with each other. Examples show how scripts reference elements, apply styles, and change styles. Different document objects like the document, anchor, button, form, image and event objects are used to access and manipulate HTML and XML documents. The DOM provides a standard programming interface for working with documents across environments and applications.
This document discusses using AJAX to fetch data from a server without refreshing the page. It describes creating an XMLHttpRequest object, opening a URL connection asynchronously, handling the asynchronous response by checking readyState and status properties, and inserting the responseText into a target DIV element on the page. Key aspects covered are setting an onreadystatechange handler, checking for readyState of 4 and status of 200, and using responseText to display the fetched data.
1. The document explains Ajax frameworks and functions from the Ajax Gold library. Ajax frameworks contain JavaScript functions that simplify making Ajax requests, reducing code. The getDataReturnText function uses GET to fetch text from a URL, calling a callback function on completion. getDataReturnXml similarly fetches XML. postDataReturnText uses POST to send data to a URL and receive a text response.
The document discusses getting started with Perl programming. It explains that Perl is an interpreter-based language mainly used for text-based work. It cannot create opaque binaries since source code must be provided to the user. The document then provides instructions on creating a simple "Hello World" Perl program by writing code in a text file saved as hello.pl, and running it from the command line. It notes that filename extensions of .pl indicate the file should be run by the Perl interpreter. Comments in Perl begin with # and there are no block comments. When a Perl program runs, the interpreter first compiles the source code into bytecode, then the bytecode engine executes it.
The document outlines various topics related to database management systems (DBMS) and shows the number of times each topic was covered in past semesters' exam papers. Some frequently covered topics include ER diagrams, relational algebra, SQL queries, integrity constraints, normalization, indexing techniques, and transactions. Less frequently covered topics include the network and object-relational data models, dynamic SQL, and transaction testing methods.
This document discusses Ajax, which allows asynchronous updating of parts of a web page without reloading the entire page. It defines Ajax as using existing technologies like JavaScript, XML, CSS, and HTML. Key points:
- Ajax permits exchanging data with a server to update parts of a page without refreshing.
- It uses the XMLHttpRequest object to communicate asynchronously with server-side scripts and send/receive different data formats.
- Popular Ajax applications include live searches, autocomplete, chatting, and updating pages without refreshes.
- Ajax works by using JavaScript to fetch server data as needed without stopping other tasks. The returned data can then update the page.
The document discusses Ajax development and frameworks, noting that Dreamweaver is the best tool for visual multiplatform Ajax development. It states that both designers and developers are important and can work together to build Ajax applications. The document also shares some links to Dreamweaver extensions that allow for Ajax development within the Dreamweaver interface.
This document discusses different techniques for reading files in Python. It begins by explaining what files are and the different types, with a focus on text files. It then demonstrates opening a file and reading the entire contents in one string. Next, it shows how to read each line of a file as a separate string using readlines(). Finally, it provides an example of printing the lines of a file in reverse order to illustrate reading files in different ways. The key techniques covered are reading the entire file, reading a specified number of characters, reading each line as a separate string, and iterating through the lines in reverse order.
XML is an extensible markup language that was designed to store and transport data. It allows data to be shared across different systems, hardware, and software. XML has several advantages over HTML including separating data from presentation, simplifying data sharing and transport, and making data more available. XML documents use tags to define elements and can also use attributes. XML documents must follow syntax rules to be well-formed, such as having matching start and end tags and properly nested elements.
The document summarizes the 7 layers of the OSI model and how data is transmitted through each layer. As data flows down the layers, it is broken into smaller pieces and encapsulated with headers at each layer. At the physical layer, data takes the form of electrical signals made up of 1s and 0s that can be transmitted across physical media.
The document discusses the TCP/IP protocol suite and compares it to the OSI model. It describes the layers of the TCP/IP model including the physical, data link, internet, and transport layers. The transport layer uses TCP and UDP, with TCP being connection-oriented and reliable, while UDP is connectionless. The internet layer uses IP to transport datagrams independently. The OSI model has 7 layers while TCP/IP has 5 layers that do not directly correspond to the OSI layers.
Groovy is a dynamic language for the Java Virtual Machine that simplifies programming through features like closures, properties, and built-in support for lists, maps, ranges, and regular expressions. The latest version 1.5 adds support for Java 5 features like annotations and generics to leverage frameworks that use them. Groovy can be integrated into applications through mechanisms like JSR-223, Spring, and Groovy's own GroovyClassLoader to externalize business rules, provide extension points, and customize applications.
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
This document contains information about Ricardo Silva's background and areas of expertise. It includes his degree in Computer Science from ISTEC and MSc in Computation and Medical Instrumentation from ISEP. It also notes that he works as a Software Developer at Shortcut, Lda and maintains a blog and email contact for Node.js topics. The document then covers several JavaScript, Node.js and Websockets topics through examples and explanations in 3 sentences or less each.
The document introduces dynamic languages and provides examples comparing Java and Groovy implementations of a filtering task. It discusses the benefits of Groovy, including its Java-like syntax, dynamic typing, built-in support for lists/maps/arrays, closures, and additional libraries that simplify APIs. Groovy aims to integrate well with Java while adding meta-programming capabilities. The document provides examples of common uses of Groovy and its features.
This document provides an introduction and overview of the Go programming language and how to build a backend API with Go and connect it to a React frontend. It discusses why Go was created, its core values and uses. It then covers how to install Go, write a basic Go program, and build a RESTful backend API with Gorilla Mux that can return JSON or XML. It also demonstrates connecting a React frontend application to the Go backend using Axios to fetch and display student data. The document encourages asking questions and building a real application with Go and React.
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
Xitrum is an asynchronous and clustered Scala web framework and HTTP server built on top of Netty and Akka. It is feature-rich, easy to use, and high performance. Xitrum can scale to a cluster of servers using Akka Cluster and Hazelcast. It is used in production systems in various countries. The document provides information on Xitrum's architecture, features, annotations, and examples of actions and SockJS messaging.
This document provides an overview of Xitrum, an asynchronous and clustered Scala web framework built on top of Netty and Akka. It describes what Xitrum is, why it should be used, how it works, examples of its features like actions, views, routing, authentication, and more. It also provides links to the Xitrum homepage, guides, community, and examples of where Xitrum is used in production.
ASTs are an incredibly powerful tool for understanding and manipulating JavaScript. We'll explore this topic by looking at examples from ESLint, a pluggable static analysis tool, and Browserify, a client-side module bundler. Through these examples we'll see how ASTs can be great for analyzing and even for modifying your JavaScript. This talk should be interesting to anyone that regularly builds apps in JavaScript either on the client-side or on the server-side.
Pascarello_Investigating JavaScript and Ajax Securityamiable_indian
The document discusses JavaScript and Ajax security. It provides background on the presenter and outlines what will be investigated, including the Ajax model, form hacks, cross-site scripting (XSS), and other injections. It then discusses the basics of Ajax, including the XMLHttpRequest object and its methods. It covers potential security issues with Ajax and demonstrates simple scripted attacks on a server.
Embedded Typesafe Domain Specific Languages for JavaJevgeni Kabanov
The document discusses embedded domain-specific languages (DSLs) for Java and provides two case studies:
1) Building SQL queries using a typesafe DSL that avoids errors and allows type inference.
2) Modifying Java bytecode using the ASM library to define a DSL for bytecode engineering.
This document provides an overview of HTML5 and its capabilities for building interactive web applications. It discusses the history and development of HTML5, including the roles of the WHATWG and W3C. It also summarizes key HTML5 features such as JavaScript, Canvas, WebSockets, storage options, and emerging 3D capabilities. Throughout, it provides examples of how these features can be used to create games, multimedia experiences, and real-time applications on the modern web.
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
This document discusses various web application frameworks including Struts 1, Spring MVC, and JavaServer Faces (JSF). It provides an overview of each framework, their terminology in relation to Java EE design patterns, examples of usage, and architectural details. Specifically, it examines the user registration process in Struts 1 through code examples and configuration files.
The document outlines the topics covered in an advanced Java programming course, including object-oriented programming concepts, Java programming fundamentals, GUI programming, networking, and server-side programming. It also provides examples of Java code demonstrating basic syntax, methods, classes, strings, and math functions.
Struts has outgrown its reputation as a simple web framework and has become more of a brand. Because of this, two next generation frameworks are being developed within the project: Shale and Action 2.0. Action 2.0 is based on WebWork, and though its backing beans are similar to JSF, its architecture is much simpler, and easier to use.
Migrating to Struts Action 2.0 is more about unlearning Struts than it is about learning the "WebWork Way". Once you understand how simple WebWork is, you'll find that Struts Action 2.0 is a powerful framework that supports action-based navigation, page-based navigation, AOP/Interceptors, components and rich Ajax support.
Come to this session to see code comparisons and learn about migration strategies to use the kick-ass web framework of 2006.
1) JSP (Java Server Pages) is a core technology for developing web applications in Java and provides a simple way to add dynamic content to web pages through Java code and reusable components.
2) JSP pages are compiled into Java servlets that generate responses, allowing developers to focus on presentation logic while business logic can be encapsulated in reusable objects.
3) Key elements of JSP include scriptlets for inline Java code, directives for configuration, expressions for output, declarations for methods, and implicit objects to access request and session information.
Boston Computing Review - Java Server PagesJohn Brunswick
1) JSP (Java Server Pages) is a core technology for developing web applications in Java and provides a simple way to add dynamic content to web pages through Java code and reusable components.
2) JSP pages are compiled into Java servlets that generate responses, allowing developers to focus on presentation logic while business logic is encapsulated in reusable objects.
3) Key elements of JSP include scriptlets for Java code, directives for configuration, expressions for output, and implicit objects for accessing request parameters and session information.
This document discusses using CouchDB on Android applications. It provides instructions on adding CouchDB functionality to an Android project using Couchbase Mobile for Android. It also describes how to access a CouchDB instance from an Android device using Futon and the Couchbase Service. The document contains code examples for creating, reading, updating and deleting CouchDB documents from an Android app.
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
abstract from http://2011.beyondtellerrand.com
Modern web technologies and responsive design aim at a platform independent code base while promising first-class experience on any mobile device. Even though purely web-based approaches can achieve stunning results, they (still) cannot compete with their native counterpart regarding platform features and integration.
In this talk, I will show you how we can use JavaScript to produce mobile apps that include features such as native UI, push notifications, sensors, and paid distribution. You can expect lots of live demos when I will compare the strengths and weaknesses of various frameworks.
The document discusses the future of server-side JavaScript. It covers various Node.js frameworks and libraries that support both synchronous and asynchronous programming styles. CommonJS aims to provide interoperability across platforms by implementing synchronous proposals using fibers. Examples demonstrate how CommonJS allows for synchronous-like code while maintaining asynchronous behavior under the hood. Benchmarks show it has comparable performance to Node.js. The author advocates for toolkits over frameworks and continuing development of common standards and packages.
This document provides an overview of best practices for Android development. It discusses topics such as UI design, including layouts and styles; using the action bar for search and progress indicators; accessibility; network connections; asynchronous tasks and services; fragments and navigation patterns; geolocation and performance; dependency injection; and recommended tools and libraries. The document provides code snippets and links to the Android developer documentation for further information on these topics.
JavaScript is evolving with the addition of modules, platform consistency, and harmony features. Modules allow JavaScript code to be organized and avoid naming collisions. CommonJS and AMD module formats are used widely. Platform consistency is improved through polyfills that mimic future APIs for older browsers. Harmony brings language-level modules and features like destructuring assignment, default parameters, and promises to JavaScript. Traceur compiles Harmony code to existing JavaScript.
Salesforce, Google, Facebook, NimbleUser -- To be sure all of our customers are using all of our best work, software as a service peeps rollout software fixes continuously, and major versions several times a year.
Learn what best practices we use to ensure each release is better than the last, with take-away pointers as to how you can use similar techniques in your own organization.
Like it or not, many open source developers are moving to the Microsoft .NET platform, and we're bringing our favorite tools with us!
In this session, we look inside ASF projects that are creating software for .NET and Mono, like Logging and Lucene.net -- to show you how to create leading-edge ASP.NET applications with ASF open source libraries, and how you can integrate with other appications using Thrift, Chemistry/DotCMIS, QPid or ActiveMQ.
We'll also look at integrating other .NET open source projects, like Spring.NET, NVelocity, and JayRock, into your C# application to create a complete open source .NET stack.
This document summarizes Ted Husted's presentation "The Secret Life of Open Source" given at ApacheCon NA in Vancouver, CA on November 10, 2011. It discusses the history and evolution of major open source projects from the 1960s to present day including GNU, Linux, Apache, PHP, Mozilla, Ubuntu, Wikipedia and LibreOffice. It also examines the different governance models and growth of open source usage in commercial products and organizations. The presentation explores how open source communities balance code, community and conscience in their operations.
Open Source Secret Sauce - Lugor Sep 2011Ted Husted
The document discusses the "Open Source Secret Sauce" - how open source projects are able to create compelling software through a volunteer model. It explains that open source projects use portals, repositories, issue trackers, mailing lists, and automated builds (PRIMA) to coordinate work. The Apache Software Foundation is provided as a successful example, with its meritocratic process allowing developers to do work and make decisions through consensus-based voting. The opportunity for open source is that it can produce successful software to solve problems like failed commercial projects.
Get hands on with Facebook and learn to connect with family and friends through the world's most popular online social network. Over the two sessions of this hands-on seminar, we will help you set up a profile, connect, and start sharing. We will introduce friending and groups, as well as creating your own special interest pages. Join us and learn what all the social networking fuss is about.
Developing java Web Applications Using Google Apps RJUG 2011Ted Husted
Introduced in April 2009, Google Apps Engine for Java has come a long way, and seems ready for primetime.
Google Apps Engine is a Platform as a Service cloud platform. Anyone can create and launch a GAE application at no charge, though resource utilization fees kick in when a site near the one million hits a month mark.
Vosao (www.vosao.org) is an open source content management system developed from the ground up on Google Apps Engine for Java over the last 18 months. Vosao CMS uses many familiar Java libraries, like Velocity templates, popular web libraries, like JQuery, and popular mashup partners, like Picasa and Disqus.
Open source secret_sauce_apache_con_2010Ted Husted
The document summarizes Ted Husted's presentation on the "Open Source Secret Sauce". It discusses how open source projects like Apache create successful products through a community-driven model. Open source projects use portals, repositories, issue trackers, mailing lists, and automated builds ("PRIMA") to enable transparency and infrastructure. This allows the community to make decisions through meritocracy. The secret sauce is creating a safe environment where developers can do work and make decisions openly.
This workshop introduces participants to building a basic Drupal site. It covers creating a hosting account, the core concepts of Drupal, and hands-on exercises for setting up a site including enabling clean URLs, adding content and roles, changing themes, configuring search, and enabling caching for production. The workshop is led by two experienced Drupal consultants and aims to help attendees get started with the CMS.
How do volunteer open-source projects create and maintain so many
compelling, competitive products? What is the Open Source Secret
Sauce? Join open-source insider, Ted Husted, as he takes us deep
inside the Apache Software Foundation, to show how the sausages are
made.
In this session, you will learn
* Why open source matters;
* How open source development works at the ASF;
* What makes open source projects successful.
Agile Analysis with Use Cases: Balancing Utility with SimplicityTed Husted
The document discusses using use cases for agile analysis. It begins with an analogy comparing use cases to the game Pong, then provides an overview of writing use cases, including identifying actors and scenarios. It also covers adapting use cases for agile projects by linking them to product backlogs and using them for iteration planning. Automating acceptance testing with use case scenarios is presented as a way to transition use cases to agile. Resources for learning more about use cases and testing automation are provided.
Web applications are commonly used to transmit, accept and store data that is personal, company confidential and sensitive.
More enterprises are spending more time testing web applications, but many still do not integrate security testing into an application's overall test plan.
In this presentation, we explore ways to integrate security testing into an end-to-end test plan, exercise security features in unit tests, integration tests, acceptance tests.
The Yahoo UI (YUI) Library is well known for its excellent documentation. One of its secrets is YUI Doc, a Python application used at build time to generate API documentation for JavaScript code.
But is YUI Doc really better than JS Doc Toolkit -- an elder application, written in JavaScript, that also generates API documentation. When should you choose one over the other? Which is the better choice for your project?
The Yahoo UI (YUI) Library is well known for its high quality code. One of its secrets is YUI Test, a testing framework for browser-based JavaScript solutions. QUnit is the unit testrunner for the jQuery project, another high quality library. If you are ready to unit test your own JavaScript code, which is the better choice : YUI Unit orQUnit?
Not long ago, testing web applications with Ajax components meant play-testing a page by hand. Today, there are a growing number of tools we can use to simplify and automate Ajax testing.
In this session we will cover when to test, what to test and how to test web applications with Ajax components. You learn how to create automatic tests with tools like OpenQA Selenium, and how to use Ajax testing tools with continuous integration systems, like
CruiseControl or Hudson.
The document discusses testing Ajax applications, including when to test, what to test, and how to test. It provides an overview of the Selenium and Hudson tools for automating Ajax testing and integrating it with continuous integration. It then demonstrates using these tools to automate testing of an Ajax application.
Not long ago, testing Ajax components meant play-testing a page by hand. Today, there are a growing number of tools we can use to simplify and automate Ajax testing.
In this session we will cover when to test, what to test and how to test Ajax components. You learn how to create automatic tests with various tools, including YUI Test, and OpenQA Selenium, and how to use Ajax testing tools with IDEs and Continuous Integration systems.
In this session, you will learn:
* When, where and how to test Ajax components;
* How to create automatic tests with various tools;
* How to use Ajax testing tools with IDEs and Continuous Integration systems.
How do volunteer open-source projects create and maintain so many compelling, competitive products? What is the Open Source Secret Sauce? Join open-source insider, Ted Husted, as he takes us deep inside the Apache Software Foundation, to show how the sausages are made.
Top mailing list providers in the USA.pptxJeremyPeirce1
Discover the top mailing list providers in the USA, offering targeted lists, segmentation, and analytics to optimize your marketing campaigns and drive engagement.
The Genesis of BriansClub.cm Famous Dark WEb PlatformSabaaSudozai
BriansClub.cm, a famous platform on the dark web, has become one of the most infamous carding marketplaces, specializing in the sale of stolen credit card data.
How MJ Global Leads the Packaging Industry.pdfMJ Global
MJ Global's success in staying ahead of the curve in the packaging industry is a testament to its dedication to innovation, sustainability, and customer-centricity. By embracing technological advancements, leading in eco-friendly solutions, collaborating with industry leaders, and adapting to evolving consumer preferences, MJ Global continues to set new standards in the packaging sector.
Understanding User Needs and Satisfying ThemAggregage
https://www.productmanagementtoday.com/frs/26903918/understanding-user-needs-and-satisfying-them
We know we want to create products which our customers find to be valuable. Whether we label it as customer-centric or product-led depends on how long we've been doing product management. There are three challenges we face when doing this. The obvious challenge is figuring out what our users need; the non-obvious challenges are in creating a shared understanding of those needs and in sensing if what we're doing is meeting those needs.
In this webinar, we won't focus on the research methods for discovering user-needs. We will focus on synthesis of the needs we discover, communication and alignment tools, and how we operationalize addressing those needs.
Industry expert Scott Sehlhorst will:
• Introduce a taxonomy for user goals with real world examples
• Present the Onion Diagram, a tool for contextualizing task-level goals
• Illustrate how customer journey maps capture activity-level and task-level goals
• Demonstrate the best approach to selection and prioritization of user-goals to address
• Highlight the crucial benchmarks, observable changes, in ensuring fulfillment of customer needs
At Techbox Square, in Singapore, we're not just creative web designers and developers, we're the driving force behind your brand identity. Contact us today.
3 Simple Steps To Buy Verified Payoneer Account In 2024SEOSMMEARTH
Buy Verified Payoneer Account: Quick and Secure Way to Receive Payments
Buy Verified Payoneer Account With 100% secure documents, [ USA, UK, CA ]. Are you looking for a reliable and safe way to receive payments online? Then you need buy verified Payoneer account ! Payoneer is a global payment platform that allows businesses and individuals to send and receive money in over 200 countries.
If You Want To More Information just Contact Now:
Skype: SEOSMMEARTH
Telegram: @seosmmearth
Gmail: seosmmearth@gmail.com
Taurus Zodiac Sign: Unveiling the Traits, Dates, and Horoscope Insights of th...my Pandit
Dive into the steadfast world of the Taurus Zodiac Sign. Discover the grounded, stable, and logical nature of Taurus individuals, and explore their key personality traits, important dates, and horoscope insights. Learn how the determination and patience of the Taurus sign make them the rock-steady achievers and anchors of the zodiac.
𝐔𝐧𝐯𝐞𝐢𝐥 𝐭𝐡𝐞 𝐅𝐮𝐭𝐮𝐫𝐞 𝐨𝐟 𝐄𝐧𝐞𝐫𝐠𝐲 𝐄𝐟𝐟𝐢𝐜𝐢𝐞𝐧𝐜𝐲 𝐰𝐢𝐭𝐡 𝐍𝐄𝐖𝐍𝐓𝐈𝐃𝐄’𝐬 𝐋𝐚𝐭𝐞𝐬𝐭 𝐎𝐟𝐟𝐞𝐫𝐢𝐧𝐠𝐬
Explore the details in our newly released product manual, which showcases NEWNTIDE's advanced heat pump technologies. Delve into our energy-efficient and eco-friendly solutions tailored for diverse global markets.
Easily Verify Compliance and Security with Binance KYCAny kyc Account
Use our simple KYC verification guide to make sure your Binance account is safe and compliant. Discover the fundamentals, appreciate the significance of KYC, and trade on one of the biggest cryptocurrency exchanges with confidence.
[To download this presentation, visit:
https://www.oeconsulting.com.sg/training-presentations]
This PowerPoint compilation offers a comprehensive overview of 20 leading innovation management frameworks and methodologies, selected for their broad applicability across various industries and organizational contexts. These frameworks are valuable resources for a wide range of users, including business professionals, educators, and consultants.
Each framework is presented with visually engaging diagrams and templates, ensuring the content is both informative and appealing. While this compilation is thorough, please note that the slides are intended as supplementary resources and may not be sufficient for standalone instructional purposes.
This compilation is ideal for anyone looking to enhance their understanding of innovation management and drive meaningful change within their organization. Whether you aim to improve product development processes, enhance customer experiences, or drive digital transformation, these frameworks offer valuable insights and tools to help you achieve your goals.
INCLUDED FRAMEWORKS/MODELS:
1. Stanford’s Design Thinking
2. IDEO’s Human-Centered Design
3. Strategyzer’s Business Model Innovation
4. Lean Startup Methodology
5. Agile Innovation Framework
6. Doblin’s Ten Types of Innovation
7. McKinsey’s Three Horizons of Growth
8. Customer Journey Map
9. Christensen’s Disruptive Innovation Theory
10. Blue Ocean Strategy
11. Strategyn’s Jobs-To-Be-Done (JTBD) Framework with Job Map
12. Design Sprint Framework
13. The Double Diamond
14. Lean Six Sigma DMAIC
15. TRIZ Problem-Solving Framework
16. Edward de Bono’s Six Thinking Hats
17. Stage-Gate Model
18. Toyota’s Six Steps of Kaizen
19. Microsoft’s Digital Transformation Framework
20. Design for Six Sigma (DFSS)
To download this presentation, visit:
https://www.oeconsulting.com.sg/training-presentations
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...my Pandit
Explore the fascinating world of the Gemini Zodiac Sign. Discover the unique personality traits, key dates, and horoscope insights of Gemini individuals. Learn how their sociable, communicative nature and boundless curiosity make them the dynamic explorers of the zodiac. Dive into the duality of the Gemini sign and understand their intellectual and adventurous spirit.
Part 2 Deep Dive: Navigating the 2024 Slowdownjeffkluth1
Introduction
The global retail industry has weathered numerous storms, with the financial crisis of 2008 serving as a poignant reminder of the sector's resilience and adaptability. However, as we navigate the complex landscape of 2024, retailers face a unique set of challenges that demand innovative strategies and a fundamental shift in mindset. This white paper contrasts the impact of the 2008 recession on the retail sector with the current headwinds retailers are grappling with, while offering a comprehensive roadmap for success in this new paradigm.
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....Lacey Max
“After being the most listed dog breed in the United States for 31
years in a row, the Labrador Retriever has dropped to second place
in the American Kennel Club's annual survey of the country's most
popular canines. The French Bulldog is the new top dog in the
United States as of 2022. The stylish puppy has ascended the
rankings in rapid time despite having health concerns and limited
color choices.”
❼❷⓿❺❻❷❽❷❼❽ Dpboss Matka Result Satta Matka Guessing Satta Fix jodi Kalyan Final ank Satta Matka Dpbos Final ank Satta Matta Matka 143 Kalyan Matka Guessing Final Matka Final ank Today Matka 420 Satta Batta Satta 143 Kalyan Chart Main Bazar Chart vip Matka Guessing Dpboss 143 Guessing Kalyan night
How to Implement a Strategy: Transform Your Strategy with BSC Designer's Comp...Aleksey Savkin
The Strategy Implementation System offers a structured approach to translating stakeholder needs into actionable strategies using high-level and low-level scorecards. It involves stakeholder analysis, strategy decomposition, adoption of strategic frameworks like Balanced Scorecard or OKR, and alignment of goals, initiatives, and KPIs.
Key Components:
- Stakeholder Analysis
- Strategy Decomposition
- Adoption of Business Frameworks
- Goal Setting
- Initiatives and Action Plans
- KPIs and Performance Metrics
- Learning and Adaptation
- Alignment and Cascading of Scorecards
Benefits:
- Systematic strategy formulation and execution.
- Framework flexibility and automation.
- Enhanced alignment and strategic focus across the organization.
Building Your Employer Brand with Social MediaLuanWise
Presented at The Global HR Summit, 6th June 2024
In this keynote, Luan Wise will provide invaluable insights to elevate your employer brand on social media platforms including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok. You'll learn how compelling content can authentically showcase your company culture, values, and employee experiences to support your talent acquisition and retention objectives. Additionally, you'll understand the power of employee advocacy to amplify reach and engagement – helping to position your organization as an employer of choice in today's competitive talent landscape.
1. Ajax on Struts:
Coding an Ajax Application with Struts 2
Wednesday, October 1st, 2:35p-3:35p
Ted Husted
In this session, we explore
How to integrate an Ajax UI framework with a
Struts 2 business framework.
Business services Struts can provide to an Ajax UI,
Basics of the Struts 2 web application framework.
Basics of the Yahoo User Interface Library (YUI).
3. Ajax on Struts
For the latest version of this presentation,
visit http://slideshare.com/ted.husted
For the latest version of source code,
visit http://code.google.com/p/yazaar/
4. Abstract
Ajax is the web's hottest user interface.
Struts is Java's most popular web
framework. What happens when we put
Ajax on Struts?
During the session, we will cover
Integrating an Ajax UI with Struts 2
Using Yahoo User Interface (YUI) Library
Using Struts to provide services to Ajax UI
5. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side data?
What about error-handling?
6. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side data?
What about error-handling?
7. What are Ajax widgets?
Ajax lets scripts make requests and
update content without a page refresh
Widgets are “black-box” user interfrace
(UI) components
Typically, widgets are configured without
touching the component's internals
DataGrids, Calendars, Carousels, even
TextBoxes
8. What are Ajax widgets?
Widgets can be used with any server platform
PHP, Java, .NET, Ruby, Python
Client-side widget provides UI
Server-side technology provides data access
and business logic
9. What is Apache Struts?
Free open-source framework for creating
Java web applications
Provides three major components
Request handler
Response handler
Tag libraries for JSP, as well as
Freemarker, and Velocity
10. Can we use Ajax with a Struts
application?
XHR is just another request/response
Struts can stream data as a response
Use JSP scriptlets
Use Ajax JSP tag libraries
Use plain-vanilla Ajax libraries
11. Why use Apache Struts?
Mature, well-supported, well-understood
Provides input validation and data conversion
Interacts well with Spring, Hibernate, et al
Defacto standard for Java web applications
12. Where do we start?
Case study
Pure Ajax prototype
Test data encapsulated as JSON
Later, replace test data with JSON via XHR
Use “spikes” to separates concerns
13. How do we select an Ajax library?
Submit before you commit
Code your own sample application
Pick the one that works for you and
yours
We tried Dojo and YUI
16. Why Yahoo User Interface
(YUI) Library?
Well documented and supported
Lots of working examples
New BSD license
Easy to read code
Easy to hack code
17. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side daa?
What about error-handling?
18. What did we code?
1 Provide a list of employees
2 Record employee's first name, last name,
extension, username, hire date, and hours
worked per week.
3 Record to be updated by authorized users
4 Allow list to be filtered by first name, last
name, or username.
5 Allow full or filtered list to be sorted by any
field
19. What did we code?
Use YUI DataTable to display list
Share DataTable record with data-entry
form
Use TabView to separate list and edit
20.
21.
22. What are we going to code?
Prototype with static data
Request data from Struts 2 Action
Use Struts 2 Plugin to return JSON
23. How does the Struts 2
JSON plugin work?
Exposes action properties as fields in a
JSON record.
{
stringValue : quot;A string valuequot;,
intArray: [10, 20],
map: {
Zaphod : quot;Just this guy, you knowquot;,
Arthur : quot;Monkey-boyquot;
},
record: quot;start a named recordquot;
}
24. public class ExampleOutputAction {
private String stringValue = quot;A string valuequot;;
public String getStringValue() {
return stringValue;
}
public void setStringValue(String value) {
stringValue = value;
}
private int[] intArray = {10, 20};
public int[] getIntArray() {
return intArray;
}
public void setIntArray(int[] value) {
intArray = value;
}
private Map map = new HashMap();
public Map getMap() {
return map;
}
public void setMap(Map value) {
map = value;
}
25. private String nextRecord = quot;start a named recordquot;;
@JSON(name=quot;recordquot;)
public String getNextRecord() {
return nextRecord;
}
//'transient' fields are not serialized
@SuppressWarnings(quot;unusedquot;)
private transient String stayHome;
//fields without getter method are not serialized
@SuppressWarnings(quot;unusedquot;)
private String noGetterForMe;
public String execute() {
map.put(quot;Zaphodquot;, quot;Just this guy, you knowquot;);
map.put(quot;Arthurquot;, quot;Monkey-Boyquot;);
return quot;successquot;;
}
}
26.
27. {
quot;intArrayquot;:[10,20],
quot;mapquot;: { quot;Arthurquot;: quot;Monkey-Boyquot;,
quot;Zaphodquot;:quot;Just this guy, you knowquot;},
quot;recordquot;:quot;start a named recordquot;,
quot;stringValuequot;:quot;A string valuequot;
}
{
stringValue : quot;A string valuequot;,
intArray: [10, 20],
map: {
Zaphod : quot;Just this guy, you knowquot;,
Arthur : quot;Monkey-boyquot;
},
record: quot;start a named recordquot;
}
29. How did we code a UI using
static data?
Entry list
Entry form
List shares data with form
30.
31.
32. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side data?
What about error-handling?
33. Is there an Ajax architecture?
<script src=quot;my.jsquot; type=quot;text/javascriptquot;>
</script>
if (typeof parent.MY != quot;undefinedquot;) {
var MY = parent.MY; // Prototype namespace
var my = parent.my; // Variable namespace
} else var
var MY = {};
var my = {};
var MY.Event = {
// ...
}
var my.oEvent = {
// ... instantiate rest of my and MY
34. Is there an Ajax architecture?
<script src=quot;contacts.jsquot; type=quot;text/javascriptquot;>
</script>
MY.Contacts = function(){
MY.Contacts.superclass.constructor.call(this);
};
YAHOO.lang.extend(MY.Contacts,YAHOO.yazaar.flev-base);
35. What's a FLEV widget?
Common business workflow is
Find / List / Edit / View
Or quot;FLEVquot;
The FLEV widget defines one columnset
and datasource to use with all four
presentations
36. MY.Contact.prototype.oColumnHeaders = [
{key:quot;first_namequot;, text:quot;First Namequot;,
sortable:true, resizeable:true,
editor:quot;textboxquot;, formClassName: quot;requiredquot;,
formTitle: quot;Enter employee's first namequot;},
// more entries
];
key and text are shared attributes
sortable, resizable are List attribute
formClassName, formtitle are Edit
attributes (validation)
39. <script type=quot;text/javascriptquot;>
var onContentReady = function() {
_Contact = new MY.Contact();
my.oEvent.subscribe(quot;contactLoadquot;,_Contact.load,
_Contact);
my.oEvent.onContactLoadReturn(_Contact.LOCAL_DATA);
};
YAHOO.util.Event.onContentReady(quot;elBodyquot;,
onContentReady);
</script>
40.
41. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side data?
What about error-handling?
42. How can we switch over to
server-side data?
Create an example Action that returns
example data
Create a database Action that returns
persistent data
43. public class ContactLoadAction {
private List contactLoad = new ArrayList();
@JSON(name=quot;resultquot;)
public List getContactLoad() {
contactLoad.add(new Contact(
quot;c5b6bbb1-66d6-49cb-9db6-743af6627828quot;,
quot;Beeblebroxquot;,
quot;Zaphodquot;,
quot;555-123-4565quot;,
quot;zaphiequot;,
quot;04/01/1978quot;,
quot;-1quot;,
quot;1quot;
));
// ...
return contacts;
}
44. public class Contact {
public Contact() {};
public Contact(String id, String last_name, String first_name,
String extension, String username, String hired, String hours,
String editor) {
setId(id);
setLast_name(last_name);
setFirst_name(first_name);
setExtension(extension);
setUsername(username);
setHired(new Date(hired));
setHours(new Double(hours));
setEditor(editor);
}
private String id;
public void setId(String value) {
id = value;
}
public String getId() {
return id;
}
// more properties ...
45.
46. How can we switch over to
server-side data?
Action data:
{quot;resultquot;:[{quot;editorquot;:quot;1quot;,quot;extensionquot;:quot;555-123-
4565quot;,quot;first_namequot;:quot;Zaphod quot;, ...
]}
JavaScript data:
MY.Contact.prototype.LOCAL_DATA =
{result:[{id: 'c5b6bbb1-66d6-49cb-9db6-
743af6627828', last_name: 'Beeblebrox ', first_name:
'Zaphod ' ...
53. What about JavaScript Hijacking?
/* {quot;resultquot;:[{quot;editorquot;:quot;1quot;,quot;extensionquot;:quot;555-123-4565quot;,
...
}]} */
var data = o.responseText;
var payload =
eval(quot;(quot;+data.substring(data.indexOf(quot;/*quot;)+2,
data.lastIndexOf(quot;*/quot;))+quot;)quot;);
my.oEvent.onContactLoadReturn(payload);
56. Ajax on Struts
What are Ajax widgets?
What are we coding?
Is there an Ajax architecture?
How can we switch to server-side data?
What about error-handling?
57. What about error handling?
var callback = {
success : function(o) {
var payload = eval(quot;(quot; + o.responseText + quot;)quot;);
my.oEvent.onContactLoadReturn(payload);
}
};
YAHOO.util.Connect.asyncRequest('POST', quot;contact-
load.doquot;, callback, null);
58. What about error handling?
var callback =
{
success: function(o) {/*success handler code*/},
failure: function(o) {/*failure handler code*/},
argument: [argument1, argument2, argument3]
}
60. How does Struts handle exceptions?
<global-results>
<result name=quot;errorquot;/>
</global-results>
<global-exception-mappings>
<exception-mapping
exception=quot;java.lang.Exceptionquot; result=quot;errorquot;/>
</global-exception-mappings>
61. How does Struts handle exceptions?
<h2>An unexpected error has occurred</h2>
<p>Please report this error to your system
administrator or appropriate technical support
personnel. Thank you for your cooperation.</p>
<hr/>
<h3>Error Message</h3>
<p>
<s:property value=quot;%{exception.message}quot;/>
</p>
<hr/>
<h3>Technical Details</h3>
<p>
<s:property value=quot;%{exceptionStack}quot;/>
</p>
62. How does Struts handle exceptions?
public String getExceptionMessage() {
ActionContext context = ActionContext.getContext();
Object value = context.getValueStack().
findValue(quot;exception.messagequot;);
if (value==null) return null;
return value.toString();
}
public String getExceptionStack() {
ActionContext context = ActionContext.getContext();
Object value = context.getValueStack().
findValue(quot;exceptionStackquot;);
if (value==null) return null;
return value.toString();
}
63. How does Struts handle exceptions?
public String execute() throws Exception {
throw new Exception(quot;Whoops!quot;);
// return quot;successquot;;
}
getExceptionMessage :” “Whoops!”
getExceptionStack: “java.lang.exception
Whoops! at actions.ContactLoadAction
...
64. How do widgets handle errors?
<!-- ... -->
</div>
<div id=quot;elErrorquot; class=quot;errorquot;></div>
<div
<!-- ... -->
65. How do widgets handle errors?
my.asyncRequestException = function (o) {
alert(quot;Error Communicating with Server! See
message area for details.quot;);
var sTemplate = quot;<table>
<tr><th>Message: </th>
<td>{exceptionMessage}</td></tr>
<tr><th>Location:</th>
<td>{exceptionStack}</td></tr>
</table>quot;;
var oPayload = eval(quot;(quot; + o + quot;)quot;) ;
document.getElementById(quot;elErrorquot;).innerHTML =
sTemplate.supplant(oPayload);
70. my.asyncRequestException = function (oPayload) {
my.errorMessage(oPayload.exceptionMessage,
oPayload.exceptionStack);
};
my.errorMessage = function (sMessage, sStackTrace) {
alert(quot;Error Communicating with Server! // ...
var sTemplate = quot;<table><tr> // ...
var oContext = {message: sMessage,
stackTrace: sStackTrace};
document.getElementById(quot;elErrorquot;).innerHTML =
sTemplate.supplant(oContext);
my.isMessage(true);
my.error(oContext);
};
71.
72.
73. Is that all there is?
During this session, we covered
Integrating an Ajax UI with Struts 2
Using Yahoo User Interface (YUI) Library
Using Struts to provide services to Ajax U
75. Whats up with Planet Yazaar?
Development team Yahoo! Employees
Something like Spring, Hibernate
Unlike Apache projects
No formal mechanism for contributions
76. Whats up with Planet Yazaar?
Development team Yahoo! Employees
Something like Spring, Hibernate
Unlike Apache projects
No formal mechanism for contributions
A cathderal, rather than a bazaar
77.
78. What's up with Planet Yazaar?
Yazaar - (Yahoo + Bazaar = Yazaar)
Accepts and maintains contributor
extensions and documentation
Working toward quot;soup to nutsquot; project
documentation
Public repository with version-to-version
change logs
79.
80. What's up with Planet Yazaar?
Just as an aside ...
Yahoo GeoCities for public web site
Uses GoogleCode for repository
Google Group for mailing list and change
logs
Yahoo 360 for Blog