Apache Wicket: web applications with just Java

Slides:



Advertisements
Similar presentations
Other Web Application Development Technologies. PHP.
Advertisements

Struts 2.0.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Apache Wicket Gerolf Seitz. Web Development with just Java and a little bit of HTML.
Apache Struts Technology
Web Applications Development Using Coldbox Platform Eddie Johnston.
IBM WebSphere Portal © 2008 IBM Corporation 1 Deliver an Irresistible User Experience  Provides an interactive user experience  No programming needed,
© 2007 IBM Corporation IBM Emerging Technologies Enabling an Accessible Web 2.0 Becky Gibson Web Accessibility Architect.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
AJAX & By – Anupama Sharma. Defining Ajax Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together.
{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni.
Apache Struts Technology A MVC Framework for Java Web Applications.
Apache Wicket: web applications with just Java Xavier Hanin JavaZone ‘07.
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
Stateful Web Application Development with Spring Web Flow John Case Senior Consultant Centare Group, Ltd.
User Group 2015 Version 5 Features & Infrastructure Enhancements.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Struts 2.0 an Overview ( )
UNIT-V The MVC architecture and Struts Framework.
Lecture 2 - Struts ENTERPRISE JAVA. 2 Contents  Servlet Deployment  Servlet Filters  Model View Controllers  Struts  Dependency Injection.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryForm is used to create data entry.
WebWork in Action An introduction to WebWork Patrick A. Lightbody.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Java Server Faces Çağatay Çivici Apache MyFaces Team Member
JavaScript and The Document Object Model MMIS 656 Web Design Technologies Acknowledgements: 1.Notes from David Shrader, NSU GSCIS 2.Some material adapted.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Cost Benefit Open Source Solutions By Eyal Golan – Senior Java Tikal Knowledge Introduction to.
ExtWebDriver Open Source Project Daniel Koo Latha Nagaraj Bryan Robbins 04/23/2014.
Ajax Runtime Toolkits IBM Emerging Technologies. What is an AJAX Toolkit/Framework? An AJAX Toolkit/Runtime is more than just XMLHTTPRequest Should includes:
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
JDeveloper 10g and JavaServer Faces: High-Performance UIs on the Web Avrom Roy-Faderman Senior Programmer May, 2006.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
Presentation. Recap A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate. Taken advantage of Spring’s multi layer.
WebSphere Portal Technical Conference U.S Creating Rich Internet (AJAX) Applications with WebSphere Portlet Factory.
JSF Framework Java Server Faces Presented by Songkran Totiya (6/10/2014)
.  A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate.  Taken advantage of Spring’s multi layer injection.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
How to Build an IT Portal with Oracle Application Server Allan L Haensgen Senior Principal Instructor Oracle Corporation Session id:
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Presentation.
Team Members Tyler Lamb Kirk Olson James Woestman IRP Presentation Client Zirous Inc. Faculty Advisor Tien Nguyen 1.
Website Design Best Practices. Topics  Navigation  Readability  Portability  Frameworks for Web Design  Model View Architecture MVC  SEO  Performance.
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
By Jonathan Smith. Road Map Introduction Company Information Project Overview Java Web Design and Development Summary Relation to IUP Acknowledgments.
Apache Struts Technology A MVC Framework for Java Web Applications.
The New Face of ASP.NET ASP.NET MVC, Razor, and jQuery Ido Flatow | Senior Architect | Sela | This session is.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
Sergey Sidorov PhD student, computer software chair Computer Science department.
Speaker Name Speaker Title Speaker Title Oracle Corporation Olivier Le Diouris Principal Product Manager Oracle Corporation Building Servlet and JSP Applications.
The Share Widget Library
ORACLE ADF ONLINE TRAINING COURSE
GeneXus 9.0: Web applications at their higher power
Web Software Model CS 4640 Programming Languages for Web Applications
Apache Wicket Component Based Web Development Framework.
Unit 6-Chapter 2 Struts.
Pentaho and Yahoo User Interface (YUI)
Microsoft Office Illustrated
Design and Maintenance of Web Applications in J2EE
Java Web Application Framework
The Model Layer What is Model?
JavaServer Faces: The Fundamentals
Presentation transcript:

Apache Wicket: web applications with just Java Xavier Hanin JavaZone ‘07

Independent Java Consultant Customers Who is Xavier Hanin Independent Java Consultant Customers Open Source Renault

Agenda What is Wicket Core concepts of Wicket Developing a custom component Q&A

Wicket in a Nutshell Open Source (Apache Software Foundation) Component based Pure Java + Pure HTML Simple Enthusiastic community

What is Wicket? The technology: enabling component-oriented, programmatic manipulation of markup The mission: bringing object oriented programming to the web application view layer The reward: have a fun job and be good friends with your manager again

Achieving these goals through Keeping simple things simple Utilizing an object-oriented component model where components are truly self contained Re-applying the Model View Controller pattern on components instead of requests, with models as first class citizens Having a clean separation of concerns between HTML and Java

Achieving these goals through Providing transparent, fully automated state management Keeping configuration needs to the minimum No more XML! Making using & creating custom components easier than any framework out there

Component versus ‘traditional’ Struts, WebWork, Spring MVC, etc. Proven for web A lot of web developers available Components JSF, Wicket, Tapestry, etc. Traditional model for UI development on thick clients A lot of developers available

Excellent localization and style support Features Page composition panels, borders and markup inheritance Excellent localization and style support template and resource loading (_be.html, .xml) localized models (e.g. for labels) sophisticated resource bundle lookup (composition & inheritance hierarchy) automatic client capabilities detection

Features Integration Fancy components Spring Guice Hibernate JasperReports OSGi Fancy components sortable, filterable, pageable, data aware tables date picker, rich text editor, Google Maps tabbed panel, navigation, tree, wizard

Features State management clustering support back button support type safe sessions clustering support back button support Double submit strategies render redirect/ redirect to buffered response/ none Testing support JUnit testing extensive logging and error reporting

Ajax support and components Features Ajax support and components Ajax without writing JavaScript, Dojo, Scriptaculous, ... Header contribution Javascript & CSS URL mounting pretty URLs Component level security

Agenda What is Wicket Core concepts of Wicket Developing a custom component Q&A

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

Application Main entry point for your web application Configuration Output Wicket specific tags? Watch for markup changes every …? Defines homepage Factories for Session RequestCycle Security …

Configured in web.xml: Application <filter> <filter-name>wicket</servlet-name> <filter-class> org.apache.wicket.protocol.http.WicketFilter </filter-class> <init-param> <param-name>applicationClassName</param-name> <param-value>example.MyApplication</param-value> </init-param> <load-on-startup>1</load-on-startup> </filter>

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

Abstraction of a user session Storage typically in HttpSession Stores session specific data Locale, Client info (browser vendor and version) Your own data? Logged in user Shopping cart contents Limited page history for back button support

Session class MySession extends WebSession { private ShoppingCart cart; public ShoppingCart getCart() { … } public void setCart(ShoppingCart cart) { … } } mysession.setCart(new ShoppingCart()); … ShoppingCart cart = mysession.getCart(); cart.add(quantity, selectedProduct);

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

Steps in a request cycle: Create request cycle object Decode the request Identify request target (page, component, …) Process event (onClick, onSubmit, …) Respond (page, component, image, pdf, …) Clean up

RequestCycle Two types of requests: Stateful Stateless Tied to specific user session Not bookmarkable Stateless Not necessarily tied to specific user session Bookmarkable

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

encapsulate the programmatic manipulation of markup Components encapsulate the programmatic manipulation of markup can receive an event onClick, onSubmit know how and where to render itself

Ultimate super class wicket.Component Label MultiLineLabel TextField PasswordTextField Image Link Tree BookmarkablePageLink JasperReports ListView Loop PagingNavigator ImageMap Button Ajax… Sorting, paging repeaters Wizard DatePicker

Components and markup A component is identified in markup with wicket:id Html: <h1 wicket:id=“msg”>Gets replaced</h1> Java: new Label(“msg”, “Hello, World!”); Final (wicket tags can be stripped): <h1>Hello, World!</h1>

Component can have its own markup file Components and markup Component can have its own markup file Page Panel Border Put java, markup and supporting files in same package on class path

A page: Hello, World!

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

Behaviors Behaviors are plug-ins for Components They can modify the components markup item.add(new AbstractBehavior() { public void onComponentTag( Component component, ComponentTag tag) { String css = (((Item)component).getIndex() % 2 == 0) ? "even" : "odd"; tag.put("class", css); } }); Output: <tr class=“odd”>…</tr> <tr class=“even”>…</tr>

Behaviors Change attributes of your component’s markup Add javascript events Add Ajax behavior component.add( new AjaxSelfUpdatingBehavior( Duration.seconds(1)));

Wicket’s concepts Application Session RequestCycle Components Behaviors Models

<<Person>> Models Models bind your POJO’s to Wicket components Label(“name”, model) <<Person>> +name : String +city : String PropertyModel

Lazy binding in Java sucks Models Lazy binding in Java sucks Doesn’t update: new TextField(“txt”, person.getName()) Gives null pointers: new Label(“street”, person.getAddress().getStreet()) Solution: OGNL/EL like expressions

Be aware for nulls when using updates: Models PropertyModel: new PropertyModel(person, “name”) new PropertyModel(person, “address.street”) Be aware for nulls when using updates: Person p = new Person(); new TextField(“street”, new PropertyModel(p, “address.street”));

Agenda What is Wicket Core concepts of Wicket Developing a custom component Q&A

Why a custom component? Eelco Hillenius: « Imagine being told that you can use Java as your programming language, but at the same time being told not to create your own classes. [...] I fail to understand why that has to be different for UI development, and Wicket proves it doesn't have to be so. »

Custom components for all 464 pages 20 minutes

Example: Password strength weak medium strong

Components Creating custom component is as easy as typing in ‘extends’ Extends wicket.Component down the line Available on application classpath

Example: Password strength Panels provide grouping Have own markup file Can be exchanged in pages for other components Can contribute to header Can contain any number of components, including panels

Example: Password strength

Example: Password strength

Example: Password strength

Components are reusable Put them in a JAR Package all necessary resources: HTML, JavaScript, Images, CSS class file Put JAR on classpath Ready for (re)use

Smart component oriented web framework Conclusion Smart component oriented web framework Easy creation and use of custom components Enthustiatic community Join in! http://wicket.apache.org/ users@wicket.apache.org

Agenda What is Wicket Core concepts of Wicket Developing a custom component Q&A