SlideShare a Scribd company logo
Presenting ActiveWeb making Java Web programming fun...again! Igor Polevoy
About me Developer like you
Have bad aftertaste of many web frameworks
Presented ActiveJDBC to CJUG last year at about the same time

Recommended for you

Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS

The document discusses 10 steps to make a Django site more responsive by adding a REST API and using AngularJS for the front-end: 1) Create an API endpoint for the Django models, 2) Set up the JavaScript environment and install AngularJS, 3) Create a static AngularJS site, 4) Use verbatim tags to avoid conflicts between Django and AngularJS variables, 5) Connect AngularJS to the API, 6) Take advantage of the Django REST Framework features, 7) Handle asynchronous data loading, 8) Add forms and POST requests, 9) Clean up settings.py, and 10) Document the API. The goal is to keep the back-end lightweight Django while building a more responsive and

restdjangoangularjs
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials

The document provides an agenda and overview for a SharePoint Saturday session on using SharePoint and jQuery. The session will cover the history of SharePoint and jQuery, an overview of jQuery, best practices for when to use jQuery and how to deploy and develop with it. It will also discuss using jQuery to interact with SharePoint forms and lists, and demonstrate some third party jQuery libraries.

javascriptsharepointjquery
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi

The document introduces JavaScript testing and test-driven development (TDD). It discusses why software projects fail, challenges of testing JavaScript code, and how to use the Mocha and ChaiJS frameworks for TDD and behavior-driven development (BDD). It provides an example of writing unit tests for a user service function using TDD principles, implementing the code to pass the tests, and running the tests with Mocha. Benefits of testing code include short feedback cycles, high test coverage, documentation of specifications, and less time spent debugging.

unit testingbrowserran mizrahi
Was suggested to shut up and make a change
Currently a Chief Technologist at ProductiveEdge, Chicago
But why? Don't we have enough frameworks in Java? Restlet Brill Aranea Web Framework RSF JSF RichFaces Strecks Google Web Toolkit Aurora JPublish Jucas MyFaces WebOnSwing Chrysalis VRaptor SwingWeb Barracuda ThinWire Struts1/2 Turbine Tapestry Cocoon Spring Maverick Echo SOFIA Verge Anvil Jaffa Japple RIFE Swinglets  Millstone  Wicket  DWR  JSPWidget  JOSSO JAT  OpenXava  Stripes  Click  ZK  Caramba  wingS  Helma
All we need is: Simple to use, sophisticated on the inside

Recommended for you

Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play

This document provides an overview of the Play! web framework for Java, including how it differs from traditional Java web development approaches by avoiding servlets, portlets, XML, EJBs, JSPs, and other technologies. It demonstrates creating a simple PDF generation application using Play!, including defining a model, controller, and view. The framework uses conventions over configuration and allows rapid development through features like automatic reloading of code changes and helpful error pages.

playjava
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs

This document discusses best practices for developing useful APIs. It recommends treating all reusable code as an API and following principles like using minimal dependencies and packaging code appropriately. It also provides examples of API design patterns at the module, class, and method level, such as using dependency injection, builder patterns, and exception handling conventions. The goal is to make APIs easy to read, use, extend, and hard to misuse by learning from open source projects and following trends in API design.

javajug latvia
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell

HTML 5 is a new version of HTML that is still being developed. It aims to evolve HTML instead of reinventing it. Key features include new form elements, input types, semantic elements, APIs for offline apps, and standardized video and audio embedding. Browser support is growing but the specification may not be finalized until 2022. However, many features are already implemented and can be used today through emulation if needed.

developmentwebbarcampghent2
Full stack
Supporting TDD
Can test views
Dynamic

Recommended for you

Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K

The document discusses the goals and design of Zepto.js, a JavaScript framework for mobile web applications. It aims to have a very small codebase that is easy to use, extends native browser APIs, and avoids non-essential browser implementations. It provides a jQuery-like API but takes advantage of mobile features for better performance on small screens and devices with limited bandwidth.

htmlframeworkipad
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django

This document discusses using AngularJS with Django to build a single page application called Tweeter. Some key advantages of this approach are that it is faster since pages don't need to reload, any JavaScript framework can be used, and the backend is reusable for mobile apps. Django REST framework is used to create RESTful APIs for models like Tweets that Angular consumes through resources and controllers. Templates are used to pass data from Django to Angular initially, while Angular routing and partials handle page changes within the SPA. Overall this provides a smooth integration of Django and Angular that separates concerns for a better user experience.

Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards

The way JavaScript is standardized and improved is changing this year. Learning how will help you understand why transpilers have become so popular, and why we will likely be using them for a long time. Ember itself will need to adapt to changes in JavaScript, and we will take a look at how the existing object model might be migrated to a pure EcmaScript solution.

web developmentes2015es6
Clean URLs
Fast, lightweight (as few dependencies as possible)
Conforms to (few good) standards
Fun(because of immediate gratification)

Recommended for you

Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En

This document provides instructions for setting up an EJB 3 project that integrates with the Struts web framework. It describes creating entity beans for Book and Customer objects and defining the relationship between them. It also covers implementing a stateless session bean with local and remote interfaces to perform basic CRUD operations using the entity manager. The tutorial uses PostgreSQL as the database and provides code samples for the entity beans, session bean, and persistence configuration file.

Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...

JavaScript MVC Frameworks are all the rage these days. Theyā€™ve taken the web development world by storm. This session explores the various features of the three hottest JavaScript MVC frameworks: AngularJS, Ember.js and React.js. It also compares client-side templating vs. server-side templating and how well each framework supports Isomorphic JavaScript (code that can run both client-side and server-side). Finally, it ranks each framework on 10 different criteria using Yevgeniy Brikmanā€™s framework scorecard. Video on InfoQ: https://www.infoq.com/presentations/comparing-angular-ember-react

ember.jsangularjsreact.js
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)

This document provides an introduction to Node.js, including what it is, how it works, and some common frameworks and tools used with Node.js. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine that uses an event-driven, non-blocking I/O model to handle requests. It allows for easy development of scalable network applications. The document discusses Node.js' event loop architecture, non-blocking I/O, and provides examples of using Express, Socket.IO, Mongoose and testing with Mocha/Chai.

History First version in 2009
In parallel development with ActiveJDBC
First put in production in summer 2010
Currently in production at major insurance company, 4 websites, clustered REST web services, internal tools, displacing legacy systems (Spring/Hibernate)

Recommended for you

前ē«Æꦂčæ°
前ē«Æꦂčæ°å‰ē«Æꦂčæ°
前ē«Æꦂčæ°

The document provides an overview of front-end technologies including HTML, CSS, JavaScript, Ajax and jQuery. It discusses how the front-end interacts with the user's browser and backend servers. It describes the roles of HTML, CSS and JavaScript in content, styles and behaviors. It then covers HTML tags and structures, CSS, JavaScript basics and its use in browsers with BOM and DOM APIs. The document also summarizes Ajax and how it enables asynchronous JavaScript requests, and introduces jQuery and how it simplifies DOM and Ajax operations.

html态javascript态jquery态ajax
Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]

In this session, Aaron Gustafson introduces attendees to the client-side scripting language known as JavaScript. After being taken on a quick tour through the language's features and syntax, attendees will be introduced through a series of examples to ways in which JavaScript can progressively enhance the user experience and really make their designs sing. This session also introduces attendees to several JavaScript libraries and demonstrate how to execute the same task in each.

enhancementyuiprogressive
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom

- The original vision of the World Wide Web was as a hyperlinked document retrieval system, not for presentation, sessions, or interactivity. If it had stayed true to this vision, modern sites like Yahoo would not exist. - Browser wars in the 1990s led to proprietary technologies that frustrated developers. The introduction of JavaScript in 1995 allowed for dynamic and interactive web pages. - By the 2000s, Microsoft's Internet Explorer dominated the browser market, bringing some stability through standards like DOM and DHTML. However, cross-browser differences still posed challenges for developers.

 
ā€¢by kaven yan
crockfordjavascript
Meet new friend Navigate  to: http://localhost:8080/testapp/greeting?name=Bob Executes: public   class   GreetingController   extends   AppController{ public   void   index(){ view(ā€œnameā€, param(ā€œnameā€)); } } Renders: /WEB-INF/views/greeting/index.ftl View code: Hello, ${name}! Output: Hello, Bob! A few conventions at work here:  URL to Controller Default action view location by controller name view name by action name No configuration.  In fact, ActiveWeb has no property files, no XML, no Yaml, no text files of any kind.
Lets TDD this public   cla ss  G r eetingControllerSpec   extends   ControllerSpec{ @Test public   void   shouldRenderHelloWorld(){ request().param(ā€œnameā€, ā€œBobā€).get(ā€œindexā€); a(assigns().get(ā€œnameā€)).shouldBeEqual(ā€œBobā€); } } Test HTML content: public   class  G reet ingControllerSpec   extends   ControllerSpec{ @Test public   void   shouldRenderHelloWorld(){ request().param(ā€œnameā€, ā€œBobā€). integrateViews () .get(ā€œindexā€); a(responseContent().contains(ā€œHello,   Bob!ā€)).shouldBeTrue(); } } Convention at work: Controller name from spec name.
Configuration in code public   class   DbConfig   extends   AbstractDBConfig   { public   void   init(AppContext   context)   { environment( "development" ) .jndi( "jdbc/kitchensink_development" ); environment( "development" ).testing() .jdbc( "com.mysql.jdbc.Driver" ,   "jdbc:mysql://localhost/kitchensink_development"  ,   "root" ,   "****" );   environment( "hudson" ).testing() .jdbc( "com.mysql.jdbc.Driver" ,   "jdbc:mysql://172.30.64.31/kitchensink_hudson",  "root", "****" ); environment( "production" ) .jndi( "jdbc/kitchensink_production" ); } } DSL for environments, JNDI, JDBC and testing mode You get help from IDE and from compiler, less likely to make a typo
Structure of project Standard Maven structure,  View are located under:  /WEB-INF/views Controllers   are   in   app.controllers   package . Result: Huge selection of anything built under the  sun for Maven in general and Maven Web  specifically

Recommended for you

Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate

- Hibernate is an ORM tool that uses POJO objects and allows working with objects instead of directly with the database. - It uses a SessionFactory to provide Sessions which represent a single unit of work and handles dirty checking. Mapping is defined in XML files. - Hibernate supports complex queries using the Criteria interface to create restrictions and conditions equivalent to SQL queries.

 
ā€¢by hr1383
hibernate
Jsp
JspJsp
Jsp

The document discusses JSPs (JavaServer Pages) and how they allow for the creation of dynamic web content by mixing static HTML with Java code, describing how JSPs are translated into servlets at request time to generate dynamic output. It provides an overview of why JSPs are used, how they work, and some of their advantages over other technologies like servlets for building web applications.

 
ā€¢by DSKUMAR G
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0

What's Coming in Spring 3.0 presentation from the Colorado Software Summit. http://softwaresummit.com/2008/speakers/raible.htm

webframeworksjavaannotations
Layouts Default Layout: src/main/webapp/WEB-INF/views/layouts/default_layout.ftl < html > < head > < LINK   href = &quot;${context_path}/css/main.css&quot;   rel = &quot;stylesheet&quot; /> < script   src = &quot;${context_path}/js/jquery-1.4.2.min.js&quot; </ script > < script   src = &quot;${context_path}/js/aw.js&quot; </ script > < title > ActiveWeb -  < @yield   to = &quot;title&quot; /></ title > </ head > < body > < div   class = &quot;main&quot; > < #include   &quot;header.ftl&quot;   > ${page_content}  < #include   &quot;footer.ftl&quot;   > </ div > </ body > </ html > Serves the same purpose as Tiles or Sitemesh, but integrated into the  system as another template. There are wrapper/nested layouts too.
<@content for and <@yield Page titles with custom tags < @content   for = &quot;title&quot; > Books List </@content> This sends content to  < @yield   to = &quot;title&quot; />  located in layout Can send any content to layout with content tag, including links to CSS, JS, etc: < @content   for = &quot;js&quot; > < script   src = &quot;${context_path}/js/page_specific.js&quot;   type = &quot;text/javascript&quot; ></ script > </ @ > Content will be rendered in layout in place of  < @yield   to = &quot;js&quot; /> This allows to easily declare content specific for a page, but rendered outside  page context.
Unobtrusive JS and <@link_to < form   id = &quot;da_form&quot;   > First name:  < input   type = &quot;text&quot;   name = &quot;first_name&quot; >< br > Last name:  < input   type = &quot;text&quot;   name = &quot;last_name&quot; >   </ form > < @link_to   controller = &quot;people&quot;   action = &quot;do-get&quot;   form = &quot;da_form&quot;   destination = &quot;result&quot; > Ajax Get </ @ > Result will be inserted into: < div   id = &quot;result&quot; ></ div > No JavaScript is generated, the HTML page is clean More ways to use Ajax with  link_to Magic happens in   aw.js
Partials Naming src/main/webapp/WEB-INF/views/greeting/_hello.ftl Rendering a partial: < @render   partial = &quot;hello&quot; /> Rendering a collection with a partial (no ugly for loops building iterative HTML): Content of  _fruit.ftl :  Fruit name: ${fruit}<hr> Host page: < @render   partial = &quot;fruit&quot;   collection = fruits /> Result of rendering: Fruit name: apple<hr>Fruit name: prune<hr>Fruit name: pear<hr> Partial will iterate itself. Also: spacers, counters, first and last.

Recommended for you

Extend sdk
Extend sdkExtend sdk
Extend sdk

This presentation contains description about how to use Developer SDK/API to develop features for langoor.net website builder.

langoornetlangoornet sdk overviewlangoor
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2

Struts 2 is an MVC framework that is the successor to Struts and WebWork 2, providing a simple architecture based around interceptors, actions, and results with conventions over configuration and support for technologies like Spring, Velocity, and Ajax. It aims to bring the best of Struts 1 and WebWork 2 together while being easier to test and use through defaults and annotations. The framework can integrate with many open source libraries and supports features like localization, type conversion, and configuration through XML files and annotations.

Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC

This is a presentation I gave to the Charteris TechDay in January 2008 and will be giving at DDD Ireland.

 
ā€¢by Alan Dean

More Related Content

What's hot

jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
Dominic Arrojado
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practices
Sultan Khan
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
Tomi Juhola
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
Hannes Hapke
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
Mark Rackley
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
Ran Mizrahi
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
Clinton Dreisbach
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
Dmitry Buzdin
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
Lennart Schoors
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
Nina Zakharenko
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
Matthew Beale
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
Ankur Dongre
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Matt Raible
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
Ran Mizrahi
 
前ē«Æꦂčæ°
前ē«Æꦂčæ°å‰ē«Æꦂčæ°
前ē«Æꦂčæ°
Ethan Zhang
 
Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]
Aaron Gustafson
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
hr1383
 

What's hot (19)

jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practices
 
jQuery introduction
jQuery introductionjQuery introduction
jQuery introduction
 
Create responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJSCreate responsive websites with Django, REST and AngularJS
Create responsive websites with Django, REST and AngularJS
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KZepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
Aligning Ember.js with Web Standards
Aligning Ember.js with Web StandardsAligning Ember.js with Web Standards
Aligning Ember.js with Web Standards
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)Intro to node.js - Ran Mizrahi (28/8/14)
Intro to node.js - Ran Mizrahi (28/8/14)
 
前ē«Æꦂčæ°
前ē«Æꦂčæ°å‰ē«Æꦂčæ°
前ē«Æꦂčæ°
 
Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]Fundamental JavaScript [In Control 2009]
Fundamental JavaScript [In Control 2009]
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
 

Similar to ActiveWeb: Chicago Java User Group Presentation

Jsp
JspJsp
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
Matt Raible
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
Harsha Nagaraj
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
Alan Dean
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
SĆøren Lund
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
Ted Husted
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
John Brunswick
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
John Quaglia
 
Struts2
Struts2Struts2
Struts2
yuvalb
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
Sven Haiges
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
ciklum_ods
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
Ignacio Coloma
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
Alfresco Software
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 

Similar to ActiveWeb: Chicago Java User Group Presentation (20)

Jsp
JspJsp
Jsp
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
Extend sdk
Extend sdkExtend sdk
Extend sdk
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Introduction To ASP.NET MVC
Introduction To ASP.NET MVCIntroduction To ASP.NET MVC
Introduction To ASP.NET MVC
 
Basic testing with selenium
Basic testing with seleniumBasic testing with selenium
Basic testing with selenium
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Retrofitting
RetrofittingRetrofitting
Retrofitting
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Struts2
Struts2Struts2
Struts2
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Grails and Dojo
Grails and DojoGrails and Dojo
Grails and Dojo
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 

Recently uploaded

Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
Whatā€™s New in Teams Calling, Meetings and Devices May 2024
Whatā€™s New in Teams Calling, Meetings and Devices May 2024Whatā€™s New in Teams Calling, Meetings and Devices May 2024
Whatā€™s New in Teams Calling, Meetings and Devices May 2024
Stephanie Beckett
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
UiPath Community Day KrakĆ³w: Devs4Devs Conference
UiPath Community Day KrakĆ³w: Devs4Devs ConferenceUiPath Community Day KrakĆ³w: Devs4Devs Conference
UiPath Community Day KrakĆ³w: Devs4Devs Conference
UiPathCommunity
 

Recently uploaded (20)

Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
Whatā€™s New in Teams Calling, Meetings and Devices May 2024
Whatā€™s New in Teams Calling, Meetings and Devices May 2024Whatā€™s New in Teams Calling, Meetings and Devices May 2024
Whatā€™s New in Teams Calling, Meetings and Devices May 2024
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
č«–ę–‡ē“¹ä»‹ļ¼šA Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
UiPath Community Day KrakĆ³w: Devs4Devs Conference
UiPath Community Day KrakĆ³w: Devs4Devs ConferenceUiPath Community Day KrakĆ³w: Devs4Devs Conference
UiPath Community Day KrakĆ³w: Devs4Devs Conference
 

ActiveWeb: Chicago Java User Group Presentation

  • 1. Presenting ActiveWeb making Java Web programming fun...again! Igor Polevoy
  • 3. Have bad aftertaste of many web frameworks
  • 4. Presented ActiveJDBC to CJUG last year at about the same time
  • 5. Was suggested to shut up and make a change
  • 6. Currently a Chief Technologist at ProductiveEdge, Chicago
  • 7. But why? Don't we have enough frameworks in Java? Restlet Brill Aranea Web Framework RSF JSF RichFaces Strecks Google Web Toolkit Aurora JPublish Jucas MyFaces WebOnSwing Chrysalis VRaptor SwingWeb Barracuda ThinWire Struts1/2 Turbine Tapestry Cocoon Spring Maverick Echo SOFIA Verge Anvil Jaffa Japple RIFE Swinglets Millstone Wicket DWR JSPWidget JOSSO JAT OpenXava Stripes Click ZK Caramba wingS Helma
  • 8. All we need is: Simple to use, sophisticated on the inside
  • 14. Fast, lightweight (as few dependencies as possible)
  • 15. Conforms to (few good) standards
  • 16. Fun(because of immediate gratification)
  • 18. In parallel development with ActiveJDBC
  • 19. First put in production in summer 2010
  • 20. Currently in production at major insurance company, 4 websites, clustered REST web services, internal tools, displacing legacy systems (Spring/Hibernate)
  • 21. Meet new friend Navigate to: http://localhost:8080/testapp/greeting?name=Bob Executes: public class GreetingController extends AppController{ public void index(){ view(ā€œnameā€, param(ā€œnameā€)); } } Renders: /WEB-INF/views/greeting/index.ftl View code: Hello, ${name}! Output: Hello, Bob! A few conventions at work here: URL to Controller Default action view location by controller name view name by action name No configuration. In fact, ActiveWeb has no property files, no XML, no Yaml, no text files of any kind.
  • 22. Lets TDD this public cla ss G r eetingControllerSpec extends ControllerSpec{ @Test public void shouldRenderHelloWorld(){ request().param(ā€œnameā€, ā€œBobā€).get(ā€œindexā€); a(assigns().get(ā€œnameā€)).shouldBeEqual(ā€œBobā€); } } Test HTML content: public class G reet ingControllerSpec extends ControllerSpec{ @Test public void shouldRenderHelloWorld(){ request().param(ā€œnameā€, ā€œBobā€). integrateViews () .get(ā€œindexā€); a(responseContent().contains(ā€œHello, Bob!ā€)).shouldBeTrue(); } } Convention at work: Controller name from spec name.
  • 23. Configuration in code public class DbConfig extends AbstractDBConfig { public void init(AppContext context) { environment( &quot;development&quot; ) .jndi( &quot;jdbc/kitchensink_development&quot; ); environment( &quot;development&quot; ).testing() .jdbc( &quot;com.mysql.jdbc.Driver&quot; , &quot;jdbc:mysql://localhost/kitchensink_development&quot; , &quot;root&quot; , &quot;****&quot; ); environment( &quot;hudson&quot; ).testing() .jdbc( &quot;com.mysql.jdbc.Driver&quot; , &quot;jdbc:mysql://172.30.64.31/kitchensink_hudson&quot;, &quot;root&quot;, &quot;****&quot; ); environment( &quot;production&quot; ) .jndi( &quot;jdbc/kitchensink_production&quot; ); } } DSL for environments, JNDI, JDBC and testing mode You get help from IDE and from compiler, less likely to make a typo
  • 24. Structure of project Standard Maven structure, View are located under: /WEB-INF/views Controllers are in app.controllers package . Result: Huge selection of anything built under the sun for Maven in general and Maven Web specifically
  • 25. Layouts Default Layout: src/main/webapp/WEB-INF/views/layouts/default_layout.ftl < html > < head > < LINK href = &quot;${context_path}/css/main.css&quot; rel = &quot;stylesheet&quot; /> < script src = &quot;${context_path}/js/jquery-1.4.2.min.js&quot; </ script > < script src = &quot;${context_path}/js/aw.js&quot; </ script > < title > ActiveWeb - < @yield to = &quot;title&quot; /></ title > </ head > < body > < div class = &quot;main&quot; > < #include &quot;header.ftl&quot; > ${page_content} < #include &quot;footer.ftl&quot; > </ div > </ body > </ html > Serves the same purpose as Tiles or Sitemesh, but integrated into the system as another template. There are wrapper/nested layouts too.
  • 26. <@content for and <@yield Page titles with custom tags < @content for = &quot;title&quot; > Books List </@content> This sends content to < @yield to = &quot;title&quot; /> located in layout Can send any content to layout with content tag, including links to CSS, JS, etc: < @content for = &quot;js&quot; > < script src = &quot;${context_path}/js/page_specific.js&quot; type = &quot;text/javascript&quot; ></ script > </ @ > Content will be rendered in layout in place of < @yield to = &quot;js&quot; /> This allows to easily declare content specific for a page, but rendered outside page context.
  • 27. Unobtrusive JS and <@link_to < form id = &quot;da_form&quot; > First name: < input type = &quot;text&quot; name = &quot;first_name&quot; >< br > Last name: < input type = &quot;text&quot; name = &quot;last_name&quot; > </ form > < @link_to controller = &quot;people&quot; action = &quot;do-get&quot; form = &quot;da_form&quot; destination = &quot;result&quot; > Ajax Get </ @ > Result will be inserted into: < div id = &quot;result&quot; ></ div > No JavaScript is generated, the HTML page is clean More ways to use Ajax with link_to Magic happens in aw.js
  • 28. Partials Naming src/main/webapp/WEB-INF/views/greeting/_hello.ftl Rendering a partial: < @render partial = &quot;hello&quot; /> Rendering a collection with a partial (no ugly for loops building iterative HTML): Content of _fruit.ftl : Fruit name: ${fruit}<hr> Host page: < @render partial = &quot;fruit&quot; collection = fruits /> Result of rendering: Fruit name: apple<hr>Fruit name: prune<hr>Fruit name: pear<hr> Partial will iterate itself. Also: spacers, counters, first and last.
  • 29. Lets flash public class BooksController extends AppController { @POST public void create(){ Book book = new Book(); book.fromMap(params1st()); if (book.save()){ flash( &quot;message&quot; , &quot;New book was added: &quot; + book.get( &quot;title&quot; )); redirect(BooksController. class ); } else { //handle errors } } } //Use in view: < @flash name = &quot;message&quot; /> Flash is a short-lived object, survives only one more request Use in POST/redirect for destructive operations
  • 30. Custom tags 1. Develop: public class HelloTag extends FreeMarkerTag{ protected void render(Map params, String body, Writer writer) throws Exception { writer.write(ā€œhelloā€); } } 2. Register: public class FreeMarkerConfig extends AbstractFreeMarkerConfig { public void init() { registerTag(ā€œhelloā€, new HelloTag()); } } 3. Use: < @hello />
  • 31. Dependency Injection with Google Guice public class HelloController extends AppController { private Greeter greeter; public void index(){ view( &quot;message&quot; , greeter.greet()); } @Inject public void setGreeter( Greeter greeter) { this .greeter = greeter; } } public class GreeterModule extends AbstractModule { protected void configure() { bind(Greeter. class ) .to(GreeterImpl. class ).asEagerSingleton(); } } public class AppBootstrap extends Bootstrap { public void init(AppContext context) { setInjector(Guice.createInjector( new GreeterModule())); } }
  • 32. TDD with DI public class GreeterMock implements Greeter{ public String greet() { return &quot;Hello from &quot; + getClass().toString(); } } public class GreeterMockModule extends AbstractModule { @Override protected void configure() { bind(Greeter. class ).to(GreeterMock. class ).asEagerSingleton(); } } public class HelloControllerSpec extends ControllerSpec { @Before public void before(){ setInjector(Guice.createInjector( new GreeterMockModule())); } @Test public void shouldTestWithMockService(){ request().get( &quot;index&quot; ); a(assigns().get( &quot;message&quot; )).shouldBeEqual( &quot;Hello from class app.services.GreeterMock&quot; ); } } Can use any mocking framework.
  • 33. Making tests web specific ā€œ Sendā€ parameters to controller: public class HelloControllerSpec extends ControllerSpec{ @Test public void shouldSendParamsToIndex(){ request() .param( &quot;first_name&quot; , &quot;John&quot; ).param( &quot;last_name&quot; , &quot;Deere&quot; ) .get( &quot;index&quot; ); a(assigns().get( &quot;message&quot; )) .shouldBeEqual( &quot;Hello, John Deere, welcome back!&quot; ); } } Seeing HTML in test! public class HelloControllerSpec extends ControllerSpec @Test public void shouldPrintGeneratedHTML(){ request(). integrateViews ().get( &quot;index&quot; ); System.out.println(responseContent()); // prints entire HMTL, decorated by layout. } }
  • 34. What else in tests? Transaction rolled back
  • 37. ā€œ Sendā€ GET, POST, DELETE, PUT HTTP requests
  • 40. Controller scenarios with IntegrationTests.
  • 41. Bootstrap entire application with AppIntegrationTests
  • 42. REST web services Controller: public class Books Controller extends AppController { public void index(){ List<Book> books = Book.findAll(); view( &quot; books&quot;, books); render().noLayout(); } } View: <? xml version = &quot;1.0&quot; encoding = &quot;UTF-8&quot; ?> < books > < #list books as book > < book > < isbn > ${book.isbn} </ isbn > < title > ${book.title} </ title > < author > ${book.author} </ author > </ book > </ #list > </ books > Access: http://host:port/context/books
  • 43. What else can controllers do? //getting parameters String name = param(ā€œnameā€); List<String> selectValues = param(ā€œmyselectā€); List<String> params = params1st(); Map<String, String[]> allParams = params(); //passing data to view view(ā€œnameā€, name); assign(ā€œnameā€, name); //detecting Ajax: if (xhr()){...} else {...} //Responding directly (short hand XML service): respond( &quot;<message>hello</message>&quot; ) .contentType( &quot;text/xml&quot; ).status( 200 ); //sending view with no layout //(useful in web services when a view is used): render().noLayout();
  • 44. Binary content in controllers //Downloading binary to client: sendFile(f).contentType( &quot;application/pdf&quot; ).status( 200 ); //Streaming large content: streamOut(in).contentType( &quot;applicaiton/pdf&quot; ); //Uploading files: Iterator<FormItem> iterator = uploadedFiles(); while (iterator.hasNext()){ FormItem item = iterator.next(); name = item.getName(); if (item.isFile()){ InputStream in = item.getInputStream()); //process data } }
  • 45. @RESTful routing @RESTful public BooksController extends AppController{} verb path action used for ------------------------------------------------------------------------------------- GET /books index display a list of all books GET /books/new_form new_form HTML form for creating a new book POST /books create create a new book GET /books/id show display a specific book GET /books/id/edit_form edit_form return an HTML form for editing a books PUT /books/id update update a specific book DELETE /books/id destroy delete a specific book
  • 46. Standard routing public BooksController extends AppController{ //GET by default public void index(){} @PUT public void save(); @DELETE public void delete(); @POST public void update(); } Allows only one HTTP method per action
  • 47. GWT Support Compile GWT client.... and PRC server on the fly: GWT server: public class EchoController extends GWTAppController implements EchoService { public String echo(String text) { return &quot;Hello from server :&quot; + text + &quot;,.... and time now is: &quot; + new Date() ; } } GWT client: business as usual GWT DEMO
  • 48. Ad hock development demo Start container
  • 55. ActiveWeb and ActiveJDBC ActiveJDBC is not baked into ActiveWeb
  • 56. ActiveJDBC is a general purpose ORM for Java
  • 57. ActiveWeb can be used with any other ORM, or without one
  • 58. ActiveWeb has nice features for managing a DB connection at runtime and during tests ā€“ tailored for ActiveJDBC, but in either case you can get access to java.sql.Connection and do with it as you wish:
  • 59. java.sql.Connection con = Base.connection();
  • 60. Conclusion Be happier with real TDD
  • 62. Have access to anything Java under the sun (there is a lot)