Apache Wicket Gerolf Seitz. Web Development with just Java and a little bit of HTML.

Slides:



Advertisements
Similar presentations
JavaScript – Quiz #8 Lecture Code:
Advertisements

Other Web Application Development Technologies. PHP.
HTML Basics Customizing your site using the basics of HTML.
Wicket in 60 Minutes Wicket 4 Newbs. Even Voorstellen...
MWD1001 Website Production Using JavaScript with Forms.
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
A Blackboard Building Block™ Crash Course for Web Developers
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
® IBM Software Group © 2006 IBM Corporation Additional AJAX Examples and Workshops This learning module provides additional AJAX use cases and examples.
Cloud Computing Lecture #7 Introduction to Ajax Jimmy Lin The iSchool University of Maryland Wednesday, October 15, 2008 This work is licensed under a.
{ Apache - Click By, By, Anupam Mundale. Anupam Mundale. Viraj Kulkarni. Viraj Kulkarni.
Apache Wicket: web applications with just Java Xavier Hanin JavaZone ‘07.
Stateful Web Application Development with Spring Web Flow John Case Senior Consultant Centare Group, Ltd.
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryForm is used to create data entry.
Lesson 8 Creating Forms with JavaScript
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
Create a Website Session I Key Components Hands-on HTML.
Java Server Faces Çağatay Çivici Apache MyFaces Team Member
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Cost Benefit Open Source Solutions By Eyal Golan – Senior Java Tikal Knowledge Introduction to.
Component-Based Software Engineering Internet Applications Paul Krause.
Server-side Scripting Powering the webs favourite services.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
AJAX Without the “J” George Lawniczak. What is Ajax?
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.
JSP Java Server Pages Softsmith Infotech.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License RSF Wiki Introduction to Reasonable Server Faces Aaron Zeckoski
Towards Industrial Strength Web Applications Brian Becker, Dyalog LTD. APL Tools Group.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Peter Laird. | 1 Building Dynamic Google Gadgets in Java Peter Laird Managing Architect WebLogic Portal BEA Systems.
® IBM Software Group © 2006 IBM Corporation “Essential” HTML Tags and Page Development Techniques This Learning Module describes the standard HTML tags.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
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.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Unit 13 –JQuery Basics Instructor: Brent Presley.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Introduction to Reasonable Server Faces Aaron Zeckoski
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
LESSON : EVENTS AND FORM VALIDATION -JAVASCRIPT. EVENTS CLICK.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
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.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
Sergey Sidorov PhD student, computer software chair Computer Science department.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Section 10.1 Define scripting
Apache Wicket: web applications with just Java
Computing with C# and the .NET Framework
The Share Widget Library
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Angular 4 + TypeScript Getting Started
Apache Wicket Component Based Web Development Framework.
Java Web Application Framework
Plug-In Architecture Pattern
Presentation transcript:

Apache Wicket Gerolf Seitz

Web Development with just Java and a little bit of HTML

Gerolf Seitz Since Sept.07 –Committer –PMC MSc student (almost finished) Software Engineer at Software Competence Center Hagenberg GmbH, Upper Austria

Agenda What is Wicket? Core Concepts Developing a custom Component Summary Q&A

Agenda What is Wicket? Core Concepts Developing a custom Component Summary Q&A

Wicket in a Nutshell Open Source Component oriented Web application framework Java + HTML

Features Everything in Java State management Safe URLs Nice URLs (mounting) OOTB support for –Clustering –Portlet

Features Reusable components Nested forms No more double submit of forms Back-button-support I18n WicketTester

Features Ajax "without" JavaScript Header Contributions –JavaScript & CSS Component level security

Hello, World! [text goes here]

Hello, World! [text goes here] + add(new Label("msg", "Hello, World!"));

Hello, World! [text goes here] + add(new Label("msg", "Hello, World!")); = Hello, World!

[text goes here] + add(new Label("msg", "Hello, World!")); = Hello, World!

[text goes here] + add(new Label("msg", "Hello, World!")); = Hello, World!

Brief History 2004: The First Encounter 2005: JavaOne'05 Smackdown 2006: Incubation at ASF

Brief History 2007: Graduation 2007: 1.3 released 2007: WUGs start spawning Amsterdam meetup: 80 attendees

Projects core extensions ioc (spring, guice) date/time velocity jmx

Getting Wicket Current Release: <dependency groupId="org.apache.wicket" artifactId="wicket" version="1.3.3" />

Getting Wicket - Quickstart

Agenda What is Wicket? Core Concepts Developing a custom Component Summary Q&A

Core Concepts Application Session RequestCycle Components Behaviors Models

Application Main entry point Initialization Configuration Factories Homepage Configured in web.xml

Application wicket org.apache.wicket.protocol.http.WicketFilter applicationClassName example.MyApplication 1

Core Concepts Application Session RequestCycle Components Behaviors Models

Session Abstraction of a user session Stores session specific data Strongly typed session attributes

Core Concepts Application Session RequestCycle Components Behaviors Models

RequestCycle Stateful –Tied to specific user session –Not (typically) bookmarkable Stateless –Not necessarily tied to specific user session –Bookmarkable

Core Concepts Application Session RequestCycle Components Behaviors Models

Components Basic building blocks Encapsulate the programmatic manipulation of markup Render content Receive events –onClick, onSubmit

Components – lots of `em Label, MultiLineLabel, TextField, PasswordTextField, Image, Link, AjaxLink, AjaxFallbackLink, Button, AjaxButton, DatePicker, ListView, RefreshingView, DataGrid, DataTable, Tree, GMap, Wizard, JasperReports,...

Components Component has wicket:id Same wicket:id in markup Hierarchy must match [gets replaced] new Label(„msg“, „Hello World!“);

Component: Link Click Link link = new Link("link"); add(link);

Component: Link Click Link link = new Link("link") public void onClick() { //do something setResponsePage(new NewPage()); } }; add(link);

Component: AjaxLink Click AjaxLink link = new AjaxLink("link") { public void onClick(AjaxRequestTarget t){ //do something } }; add(link);

Component: AjaxLink Click someComponent.setOutputMarkupId(true); AjaxLink link = new AjaxLink("link") { public void onClick(AjaxRequestTarget t){ //do something t.addComponent(someComponent); t.appendJavascript("Effects.fade('foo');"); } }; add(link);

Components Components with own markup –Page, Panel, Border Java and markup files in same package on classpath

Core Concepts Application Session RequestCycle Components Behaviors Models

Behaviors Plugins for components Change attributes of your component‘s markup Add Javascript events Add Ajax behavior timeLabel.add( new AjaxSelfUpdatingTimerBehavior( Duration.seconds(5)));

Behaviors link.add(new AbstractBehavior() { public void onComponentTag(Component component, ComponentTag tag) { tag.put("onclick", "return confirm('Are you sure?');"); } }); Output:...

Core Concepts Application Session RequestCycle Components Behaviors Models

Bind POJO's to Wicket components new Label("name", model) Model +name: String +city: String

Models Lazy binding in Java sucks –Doesn't update: new Label("name", person.getName()); –Null checks necessary new Label("street", person.getAddress().getStreet()); Solution: OGNL/EL like expressions

Models PropertyModel: –new PropertyModel(person, “name”) –new PropertyModel(person, “address.street”) CompoundPropertyModel –setModel(new CompoundPropertyModel(p)); –add(new Label("name")); –add(new Label("address.street"));

Agenda What is Wicket? Core Concepts Developing a custom Component Summary Q&A

Custom Components 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. »

PasswordStrenghIndicator Insert title here [strengthbar] Examples: (weak) (medium) (strong)

PSI - Markup [strengthbar]

PSI - Java public class PasswordField extends Panel { public final static String WEAK = "weak"; public final static String MEDIUM = "medium"; public final static String STRONG = "strong"; public PasswordField(String id, IModel model) { super(id, model); PasswordTextField passwordTextField = new PasswordTextField("password", model); add(passwordTextField); final Label strength = new Label("strength", ""); add(strength); strength.add(new AttributeModifier("class", true, new Model() { public Object getObject() { return getPasswordStrength(PasswordField.this.getModelObjectAsString()); } })); strength.setOutputMarkupId(true); passwordTextField.add(new OnKeyPausedAjaxBehavior() { protected void onUpdate(AjaxRequestTarget target) { target.addComponent(strength); } }); }}

PSI - TestPage public class TestPage extends WebPage { private String password; public TestPage() { Form form = new Form("form"); form.add(new PasswordField("password", new PropertyModel(this, "password"))); add(form); }

Agenda What is Wicket? Core Concepts Developing a custom Component Summary Q&A

Summary Component oriented web application framework Just Java and HTML Easy Ajax Enthusiastic community

Community

Future – Wicket NEXT Java 5 based –Generics (already in) –Varargs? –Typesafe PropertyModel New WicketTester –Based on JDave/Hamcrest Many more cool features

Books

Agenda What is Wicket? Core Concepts Developing a custom Component Q&A

Thank you for your attention