SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
Wicket 6
?
Quickstart
Wicket 6
Auf geht‘s
Unmanaged aber nicht
einsam
Managed
Weblayer
Glue
ORM
Management
Security
...
Wicket
Weblayer
API
Servlet 2.5 Container
<application>.war
WicketFilter
WebApplication
Aufbau
public class WicketApplication extends AuthenticatedWebApplication {

@Override

public HomePage getHomePage() {

return HomePage.class;

}



@Override

public void init() {

super.init();

getSecuritySettings().setAuthorizationStrategy(
new AnnotationsRoleAuthorizationStrategy(this));

getMarkupSettings().setAutomaticLinking(true);

mountPage("/dummy", PlainLayoutPage.class);

}



@Override

protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {

return UserAuthenticatedWebSession.class;

}



@Override

protected Class<? extends WebPage> getSignInPageClass() {

return SignInWithoutRememberMePage.class;

}

}
enabling component-
oriented, programmatic
manipulation of markup*
*http://wicket.apache.org/meet/vision.html
Good
old
Java+ HTML
Component.java
Component
Component.html
Component.properties
UserUpdatePanel.java
UserUpdatePanel.properties
UserUpdatePanel.html
public class UserUpdatePanel extends Panel{

public static final String PASSWORD = "password";

public static final String PASSWORD_REPEAT = "passwordRepeat";

public static final String USER_UPDATE_FORM = "userUpdateForm";



@Autowired

private UserRepository userRepository;



public UserUpdatePanel(String id, IModel<User> model) {

super(id, model);



FormComponent<String> password = new PasswordTextField(PASSWORD);

FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));



Form<User> userUpdateForm =

new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {

@Override

protected void onSubmit() {

userRepository.save(getModelObject());

}

};



add(userUpdateForm

.add(new TextField<String>("name"))

.add(password)

.add(passwordRepeat)

.add(new AjaxFallbackButton("submit", userUpdateForm) {})

.add(new EqualInputValidator(password, passwordRepeat))

);

}

}
<!DOCTYPE html>

<html xmlns:wicket="http://wicket.apache.org">

<head>

<meta charset="utf-8">

<title>Wicket Example App</title>

</head>

<body>

<wicket:panel>

<form wicket:id="userUpdateForm">

<fieldset>

<legend><wicket:message key="userUpdateTitle"/></legend>

<label wicket:for="name"><wicket:message key="username"/></label>

<input type="text" wicket:id="name"/>

<label wicket:for="password"><wicket:message key="password"/></label>

<input type="password" wicket:id="password"/>

<label wicket:for="passwordRepeat"><wicket:message key="passwordRepeat"/></label>

<input type="password" wicket:id="passwordRepeat"/>

<p><input type="submit" value="submit" wicket:id="submit"/></p>

</fieldset>

</form>

</wicket:panel>

</body>

</html>
userUpdateTitle=Benutzer anpassen

username=Benutzername

password=Passwort

passwordRepeat=Passwort wiederholen
public class UserUpdatePanel extends Panel{

public static final String PASSWORD = "password";

public static final String PASSWORD_REPEAT = "passwordRepeat";

public static final String USER_UPDATE_FORM = "userUpdateForm";



@Autowired

private UserRepository userRepository;



public UserUpdatePanel(String id, IModel<User> model) {

super(id, model);



FormComponent<String> password = new PasswordTextField(PASSWORD);

FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));



Form<User> userUpdateForm =

new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {

@Override

protected void onSubmit() {

userRepository.save(getModelObject());

}

};



add(userUpdateForm

.add(new TextField<String>("name"))

.add(password)

.add(passwordRepeat)

.add(new AjaxFallbackButton("submit", userUpdateForm) {})

.add(new EqualInputValidator(password, passwordRepeat))

);

}

}
<!DOCTYPE html>

<html xmlns:wicket="http://wicket.apache.org">

<head>

<meta charset="utf-8">

<title>Wicket Example App</title>

</head>

<body>

<wicket:panel>

<form wicket:id="userUpdateForm">

<fieldset>

<legend><wicket:message key="userUpdateTitle"/></legend>

<input type="text" wicket:id="name"/>

<input type="password" wicket:id="password"/>

<input type="password" wicket:id="passwordRepeat"/>

<p><input type="submit" value="submit" wicket:id="submit"/></p>

</fieldset>

</form>

</wicket:panel>

</body>

</html>
wicket:extend
wicket:child
wicket:id
wicket:message
wicket:remove
wicket:head
wicket:container
wicket:border
wicket:body
wicket:fragment
wicket:panel
wicket:link
<html xmlns:wicket="http://wicket.apache.org">
Keine
Logik
Template
im
Inheritance
UserUpdatePanel
MyUserUpdatePanel
public class MyUserUpdatePanel extends UserUpdatePanel{



public UserUpdatePanel(String id, IModel<User> model) {

super(id, model);
}

}
<!DOCTYPE html>

<html xmlns:wicket="http://wicket.apache.org">

<head>

<meta charset="utf-8">

<title>Wicket Example App</title>

</head>

<body>

<wicket:panel>

<form wicket:id="userUpdateForm">

<fieldset>

<legend><wicket:message key="userUpdateTitle"/></legend>

<input type="text" wicket:id="name"/>

<input type="password" wicket:id="password"/>

<input type="password" wicket:id="passwordRepeat"/>

<p><input type="submit" value="submit" wicket:id="submit"/></p>

</fieldset>

</form>

</wicket:panel>

</body>

</html>
MyUserUpdatePanel.html
MyUserUpdatePanel.properties
userUpdateTitle=Lustiges Felderraten
Wicket 6
MyUserUpdatePanel UserUpdatePanel Object
Got my stuff?
MyUserUpdatePanel UserUpdatePanel Object Application
Markup
Properties
...
...
Datenbeschaffung
package de.bootcamp.wicket.web.page;



public interface IModel<T> extends IDetachable

{

T getObject();

void setObject(final T object);

}
public UserUpdatePanel(String id, IModel<User> model)
public class UserUpdatePanel extends Panel{


!
...




public UserUpdatePanel(String id, IModel<User> model) {

super(id, model);



FormComponent<String> password = new PasswordTextField(PASSWORD, new PropertyModel<String>(model, "password") );

FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));



Form<User> userUpdateForm =

new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {

@Override

protected void onSubmit() {

userRepository.save(getModelObject());

}

};


...


}

}
• Entkopplung Beschaffung /Verwendung!
• Lazy!
• Chainable!
• Leicht testbar
IModel
Behavior
• AttributeAppender/AttributeModifier!
• AjaxSelfUpdatingBehavior!
• AjaxEventBehavior!
• ...
Component! Behavior.add( )
Alles zusammen
Page
public class HomePage extends WebPage {

private static final long serialVersionUID = 1L;



@SpringBean

private BusinessService businessService;



public HomePage(final PageParameters parameters) {

super(parameters);



IModel<User> userModel = new LoadableDetachableModel<User>() {

@Override

protected User load() {

return businessService.findUserByName("user1");

}

};

add(new Label("name", new PropertyModel<String>(userModel,"name")));


add(new MyUserUpdatePanel("userUpdatePanel", userModel));
!
add(new AjaxLink("adminLink") {

@Override

public void onClick(AjaxRequestTarget target) {

setResponsePage(AdminPage.class);

}

});

}

}
Praxis!!!
AJAX
• Seit Wicket 6: JQuery!!
• TransparenteVerwendung!
• Maßgeblicher Bestandteil des Wicket-Kerns!
• Einfach über Behaviors erweiterbar!
• Weiterführung der Komponentisierung
Wicket 6
NoScript>
AjaxFallbackButton!
AjaxFallbackDefaultDataTable!
AjaxFallbackHeadersToolbar!
AjaxFallbackLink!
...
AJAX
Kopplung
Callbacks
Events
Component
public interface IEventSource

{

<T> void send(IEventSink sink,
Broadcast broadcast, T payload);

}
public interface IEventSink

{

void onEvent(IEvent<?> event);

}
• Schwache Kopplung!
• hohe Flexibilität!
• weniger Boilerplate
Ajax Default Event
...
@Override

public void onEvent(IEvent<?> event) {

if(event.getPayload() instanceof AjaxRequestTarget) {

((AjaxRequestTarget)event.getPayload()).add(this);

}

}

...
WicketTester
private WicketTester wicketTester;



@Before

public void setUp() {

wicketTester = new WicketTester();

}



@After

public void tearDown() {

wicketTester.destroy();

}



@Test

public void testCreateTask() throws Exception{

IModel<TaskList> taskListMock = mock(IModel.class);

User testUser = new User();



CreateTaskPanel createTaskPanel = new CreateTaskPanel("testPanel", testUser, taskListMock);



wicketTester.startComponentInPage(createTaskPanel);

wicketTester.assertComponent("testPanel", CreateTaskPanel.class);



FormTester formTester = wicketTester.newFormTester("testPanel:taskForm");

formTester.setValue("title", "taskTitle");

formTester.submit();



ArgumentCaptor<Task> taskCaptor = ArgumentCaptor.forClass(Task.class);

verify(taskServiceMock).create(taskCaptor.capture());



assertEquals("taskTitle", taskCaptor.getValue().getTitle());

assertEquals(testUser, taskCaptor.getValue().getUser());

}
Ressourcen
• JavaScript!
• CSS!
• Bilder!
• PDF!
• ...
public class DataTablesResource extends JavaScriptResourceReference {



private static final Set<HeaderItem> deps;

static {

HashSet<HeaderItem> items = new HashSet<HeaderItem>();

items.add(JavaScriptHeaderItem.forReference(JQueryResourceReference.get()));

deps = Collections.unmodifiableSet(items);

}



private static final DataTablesResource instance = new DataTablesResource();

private DataTablesResource() {

super(DataTablesResource.class, "jquery.dataTables.js");

}



public static DataTablesResource get() {

return instance;

}



@Override

public Iterable<? extends HeaderItem> getDependencies() {

return deps;

}

}
...
!
@Override

public void renderHead(IHeaderResponse response) {

super.renderHead(response);

response.render(JavaScriptHeaderItem.forReference(DataTablesResource.get()));

}
!
...
Und weiter?
• Optimierung der verwendeten Ressourcen!
• Kontrolle der URL!
• Dependency Management!
• JavaScript ResourceBundles!
• Übersteuern vonVersionen
http://code.google.com/p/wicket-guide/
Wicket-Guide
GET IT!

Weitere ähnliche Inhalte

Was ist angesagt?

What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2Santosh Singh Paliwal
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Mahmoud Hamed Mahmoud
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Atlassian
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleMathias Seguy
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenSony Suci
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Frédéric Harper
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCaleb Jenkins
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data AccessDzmitry Naskou
 
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.0Matt Raible
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOSMake School
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"GeeksLab Odessa
 
Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin componentsPeter Lehto
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4Naga Muruga
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAravindharamanan S
 

Was ist angesagt? (20)

What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2What is the difference between struts 1 vs struts 2
What is the difference between struts 1 vs struts 2
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification Google
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 
Data binding w Androidzie
Data binding w AndroidzieData binding w Androidzie
Data binding w Androidzie
 
Eclipse Tricks
Eclipse TricksEclipse Tricks
Eclipse Tricks
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern Applications
 
Spring Framework - Data Access
Spring Framework - Data AccessSpring Framework - Data Access
Spring Framework - Data Access
 
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
 
Distributing information on iOS
Distributing information on iOSDistributing information on iOS
Distributing information on iOS
 
JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"JSLab. Алексей Волков. "React на практике"
JSLab. Алексей Волков. "React на практике"
 
Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin components
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4
 
Android ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codesAndroid ui layouts ,cntls,webservices examples codes
Android ui layouts ,cntls,webservices examples codes
 

Andere mochten auch

Guide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheMartijn Dashorst
 
Keep your Wicket application in production
Keep your Wicket application in productionKeep your Wicket application in production
Keep your Wicket application in productionMartijn Dashorst
 
Wicket 10 years and beyond
Wicket   10 years and beyond Wicket   10 years and beyond
Wicket 10 years and beyond Martijn Dashorst
 
Tapestry: State of the Union
Tapestry: State of the UnionTapestry: State of the Union
Tapestry: State of the UnionHoward Lewis Ship
 
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Martijn Dashorst
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24Matt Raible
 
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Matt Raible
 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep DiveMartijn Dashorst
 
Apache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaApache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaMartijn Dashorst
 
Architecting Applications Using Apache Wicket Java2 Days 2009
Architecting Applications Using Apache Wicket   Java2 Days 2009Architecting Applications Using Apache Wicket   Java2 Days 2009
Architecting Applications Using Apache Wicket Java2 Days 2009Mystic Coders, LLC
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworksMD Sayem Ahmed
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016Matt Raible
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016Matt Raible
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Matt Raible
 
Wicket with Spring Boot on Azure
Wicket with Spring Boot on AzureWicket with Spring Boot on Azure
Wicket with Spring Boot on AzureHiroto Yamakawa
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015Matt Raible
 
Java Collections Framework Inroduction with Video Tutorial
Java Collections Framework Inroduction with Video TutorialJava Collections Framework Inroduction with Video Tutorial
Java Collections Framework Inroduction with Video TutorialMarcus Biel
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Matt Raible
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstNLJUG
 

Andere mochten auch (20)

Guide To Successful Graduation at Apache
Guide To Successful Graduation at ApacheGuide To Successful Graduation at Apache
Guide To Successful Graduation at Apache
 
Presentazione java7
Presentazione java7Presentazione java7
Presentazione java7
 
Keep your Wicket application in production
Keep your Wicket application in productionKeep your Wicket application in production
Keep your Wicket application in production
 
Wicket 10 years and beyond
Wicket   10 years and beyond Wicket   10 years and beyond
Wicket 10 years and beyond
 
Tapestry: State of the Union
Tapestry: State of the UnionTapestry: State of the Union
Tapestry: State of the Union
 
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
Who Automates the Automators? (Quis Automatiet Ipsos Automates?)
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24
 
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
Get Hip with JHipster - Colorado Springs OSS Meetup April 2016
 
Java Serialization Deep Dive
Java Serialization Deep DiveJava Serialization Deep Dive
Java Serialization Deep Dive
 
Apache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just JavaApache Wicket: Web Applications With Just Java
Apache Wicket: Web Applications With Just Java
 
Architecting Applications Using Apache Wicket Java2 Days 2009
Architecting Applications Using Apache Wicket   Java2 Days 2009Architecting Applications Using Apache Wicket   Java2 Days 2009
Architecting Applications Using Apache Wicket Java2 Days 2009
 
A brief overview of java frameworks
A brief overview of java frameworksA brief overview of java frameworks
A brief overview of java frameworks
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - GeekOut 2016
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx UK 2016
 
Wicket with Spring Boot on Azure
Wicket with Spring Boot on AzureWicket with Spring Boot on Azure
Wicket with Spring Boot on Azure
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Devoxx 2015
 
Java Collections Framework Inroduction with Video Tutorial
Java Collections Framework Inroduction with Video TutorialJava Collections Framework Inroduction with Video Tutorial
Java Collections Framework Inroduction with Video Tutorial
 
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
Get Hip with JHipster: Spring Boot + AngularJS + Bootstrap - Angular Summit 2015
 
Apache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn DashorstApache Wicket: 10 jaar en verder - Martijn Dashorst
Apache Wicket: 10 jaar en verder - Martijn Dashorst
 

Ähnlich wie Wicket 6

Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Michael Plöd
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVCRichard Paul
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's NewTed Pennings
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...solit
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Wicket KT part 2
Wicket KT part 2Wicket KT part 2
Wicket KT part 2stuq
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!DataArt
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Abhijeet Vaikar
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web FrameworkLuther Baker
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Dan Wahlin
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejugrobbiev
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentationmrmean
 
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache Ignite
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache IgniteNeues aus dem Tindergarten: Auswertung "privater" APIs mit Apache Ignite
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache IgniteQAware GmbH
 

Ähnlich wie Wicket 6 (20)

Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6Integrating Wicket with Java EE 6
Integrating Wicket with Java EE 6
 
Unit testing with mock libs
Unit testing with mock libsUnit testing with mock libs
Unit testing with mock libs
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Spring Security.ppt
Spring Security.pptSpring Security.ppt
Spring Security.ppt
 
Wicket KT part 2
Wicket KT part 2Wicket KT part 2
Wicket KT part 2
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
ERRest
ERRestERRest
ERRest
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Human Talks - StencilJS
Human Talks - StencilJSHuman Talks - StencilJS
Human Talks - StencilJS
 
Enterprise Guice 20090217 Bejug
Enterprise Guice 20090217 BejugEnterprise Guice 20090217 Bejug
Enterprise Guice 20090217 Bejug
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
Wicket Security Presentation
Wicket Security PresentationWicket Security Presentation
Wicket Security Presentation
 
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache Ignite
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache IgniteNeues aus dem Tindergarten: Auswertung "privater" APIs mit Apache Ignite
Neues aus dem Tindergarten: Auswertung "privater" APIs mit Apache Ignite
 

Mehr von codepitbull

Mögen die Tests mit dir sein
Mögen die Tests mit dir seinMögen die Tests mit dir sein
Mögen die Tests mit dir seincodepitbull
 
Vert.x kubernetes
Vert.x kubernetesVert.x kubernetes
Vert.x kubernetescodepitbull
 
DDD and reactive frameworks
DDD and reactive frameworksDDD and reactive frameworks
DDD and reactive frameworkscodepitbull
 
Fast data und IoT
Fast data  und IoTFast data  und IoT
Fast data und IoTcodepitbull
 
Reactive Microservices mit Vert.x 3
Reactive Microservices mit Vert.x 3Reactive Microservices mit Vert.x 3
Reactive Microservices mit Vert.x 3codepitbull
 
Continuous load testing
Continuous load testingContinuous load testing
Continuous load testingcodepitbull
 
Reactive streams
Reactive streamsReactive streams
Reactive streamscodepitbull
 
Eventsourcing ftw
Eventsourcing ftwEventsourcing ftw
Eventsourcing ftwcodepitbull
 
Vertx for worlddomination
Vertx for worlddominationVertx for worlddomination
Vertx for worlddominationcodepitbull
 

Mehr von codepitbull (12)

Mögen die Tests mit dir sein
Mögen die Tests mit dir seinMögen die Tests mit dir sein
Mögen die Tests mit dir sein
 
Homeoffice
HomeofficeHomeoffice
Homeoffice
 
Vert.x kubernetes
Vert.x kubernetesVert.x kubernetes
Vert.x kubernetes
 
DDD and reactive frameworks
DDD and reactive frameworksDDD and reactive frameworks
DDD and reactive frameworks
 
Fast data und IoT
Fast data  und IoTFast data  und IoT
Fast data und IoT
 
Reactive Microservices mit Vert.x 3
Reactive Microservices mit Vert.x 3Reactive Microservices mit Vert.x 3
Reactive Microservices mit Vert.x 3
 
Continuous load testing
Continuous load testingContinuous load testing
Continuous load testing
 
Reactive streams
Reactive streamsReactive streams
Reactive streams
 
Eventsourcing ftw
Eventsourcing ftwEventsourcing ftw
Eventsourcing ftw
 
MongoDB
MongoDBMongoDB
MongoDB
 
Vertx for worlddomination
Vertx for worlddominationVertx for worlddomination
Vertx for worlddomination
 
Event loop
Event loopEvent loop
Event loop
 

Kürzlich hochgeladen

Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...OnePlan Solutions
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIIvo Andreev
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Incrobinwilliams8624
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024Mind IT Systems
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxAutus Cyber Tech
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?AmeliaSmith90
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeNeo4j
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfTobias Schneck
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorShane Coughlan
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native BuildpacksVish Abrams
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmonyelliciumsolutionspun
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntelliSource Technologies
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilVICTOR MAESTRE RAMIREZ
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfBrain Inventory
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageDista
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampVICTOR MAESTRE RAMIREZ
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadIvo Andreev
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionsNirav Modi
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsJaydeep Chhasatia
 

Kürzlich hochgeladen (20)

Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
Transforming PMO Success with AI - Discover OnePlan Strategic Portfolio Work ...
 
JS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AIJS-Experts - Cybersecurity for Generative AI
JS-Experts - Cybersecurity for Generative AI
 
Enterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze IncEnterprise Document Management System - Qualityze Inc
Enterprise Document Management System - Qualityze Inc
 
Top Software Development Trends in 2024
Top Software Development Trends in  2024Top Software Development Trends in  2024
Top Software Development Trends in 2024
 
ERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptxERP For Electrical and Electronics manufecturing.pptx
ERP For Electrical and Electronics manufecturing.pptx
 
How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?How Does the Epitome of Spyware Differ from Other Malicious Software?
How Does the Epitome of Spyware Differ from Other Malicious Software?
 
IA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG timeIA Generativa y Grafos de Neo4j: RAG time
IA Generativa y Grafos de Neo4j: RAG time
 
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdfARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
ARM Talk @ Rejekts - Will ARM be the new Mainstream in our Data Centers_.pdf
 
Kawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in TrivandrumKawika Technologies pvt ltd Software Development Company in Trivandrum
Kawika Technologies pvt ltd Software Development Company in Trivandrum
 
OpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS CalculatorOpenChain Webinar: Universal CVSS Calculator
OpenChain Webinar: Universal CVSS Calculator
 
Streamlining Your Application Builds with Cloud Native Buildpacks
Streamlining Your Application Builds  with Cloud Native BuildpacksStreamlining Your Application Builds  with Cloud Native Buildpacks
Streamlining Your Application Builds with Cloud Native Buildpacks
 
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine HarmonyLeveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
Leveraging DxSherpa's Generative AI Services to Unlock Human-Machine Harmony
 
Introduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptxIntroduction-to-Software-Development-Outsourcing.pptx
Introduction-to-Software-Development-Outsourcing.pptx
 
Generative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-CouncilGenerative AI for Cybersecurity - EC-Council
Generative AI for Cybersecurity - EC-Council
 
Why Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdfWhy Choose Brain Inventory For Ecommerce Development.pdf
Why Choose Brain Inventory For Ecommerce Development.pdf
 
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales CoverageSales Territory Management: A Definitive Guide to Expand Sales Coverage
Sales Territory Management: A Definitive Guide to Expand Sales Coverage
 
Deep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - DatacampDeep Learning for Images with PyTorch - Datacamp
Deep Learning for Images with PyTorch - Datacamp
 
Cybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and BadCybersecurity Challenges with Generative AI - for Good and Bad
Cybersecurity Challenges with Generative AI - for Good and Bad
 
eAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspectionseAuditor Audits & Inspections - conduct field inspections
eAuditor Audits & Inspections - conduct field inspections
 
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software TeamsYour Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
Your Vision, Our Expertise: TECUNIQUE's Tailored Software Teams
 

Wicket 6

  • 2. ?
  • 8. public class WicketApplication extends AuthenticatedWebApplication {
 @Override
 public HomePage getHomePage() {
 return HomePage.class;
 }
 
 @Override
 public void init() {
 super.init();
 getSecuritySettings().setAuthorizationStrategy( new AnnotationsRoleAuthorizationStrategy(this));
 getMarkupSettings().setAutomaticLinking(true);
 mountPage("/dummy", PlainLayoutPage.class);
 }
 
 @Override
 protected Class<? extends AbstractAuthenticatedWebSession> getWebSessionClass() {
 return UserAuthenticatedWebSession.class;
 }
 
 @Override
 protected Class<? extends WebPage> getSignInPageClass() {
 return SignInWithoutRememberMePage.class;
 }
 }
  • 9. enabling component- oriented, programmatic manipulation of markup* *http://wicket.apache.org/meet/vision.html
  • 12. UserUpdatePanel.java UserUpdatePanel.properties UserUpdatePanel.html public class UserUpdatePanel extends Panel{
 public static final String PASSWORD = "password";
 public static final String PASSWORD_REPEAT = "passwordRepeat";
 public static final String USER_UPDATE_FORM = "userUpdateForm";
 
 @Autowired
 private UserRepository userRepository;
 
 public UserUpdatePanel(String id, IModel<User> model) {
 super(id, model);
 
 FormComponent<String> password = new PasswordTextField(PASSWORD);
 FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));
 
 Form<User> userUpdateForm =
 new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {
 @Override
 protected void onSubmit() {
 userRepository.save(getModelObject());
 }
 };
 
 add(userUpdateForm
 .add(new TextField<String>("name"))
 .add(password)
 .add(passwordRepeat)
 .add(new AjaxFallbackButton("submit", userUpdateForm) {})
 .add(new EqualInputValidator(password, passwordRepeat))
 );
 }
 } <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org">
 <head>
 <meta charset="utf-8">
 <title>Wicket Example App</title>
 </head>
 <body>
 <wicket:panel>
 <form wicket:id="userUpdateForm">
 <fieldset>
 <legend><wicket:message key="userUpdateTitle"/></legend>
 <label wicket:for="name"><wicket:message key="username"/></label>
 <input type="text" wicket:id="name"/>
 <label wicket:for="password"><wicket:message key="password"/></label>
 <input type="password" wicket:id="password"/>
 <label wicket:for="passwordRepeat"><wicket:message key="passwordRepeat"/></label>
 <input type="password" wicket:id="passwordRepeat"/>
 <p><input type="submit" value="submit" wicket:id="submit"/></p>
 </fieldset>
 </form>
 </wicket:panel>
 </body>
 </html> userUpdateTitle=Benutzer anpassen
 username=Benutzername
 password=Passwort
 passwordRepeat=Passwort wiederholen
  • 13. public class UserUpdatePanel extends Panel{
 public static final String PASSWORD = "password";
 public static final String PASSWORD_REPEAT = "passwordRepeat";
 public static final String USER_UPDATE_FORM = "userUpdateForm";
 
 @Autowired
 private UserRepository userRepository;
 
 public UserUpdatePanel(String id, IModel<User> model) {
 super(id, model);
 
 FormComponent<String> password = new PasswordTextField(PASSWORD);
 FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));
 
 Form<User> userUpdateForm =
 new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {
 @Override
 protected void onSubmit() {
 userRepository.save(getModelObject());
 }
 };
 
 add(userUpdateForm
 .add(new TextField<String>("name"))
 .add(password)
 .add(passwordRepeat)
 .add(new AjaxFallbackButton("submit", userUpdateForm) {})
 .add(new EqualInputValidator(password, passwordRepeat))
 );
 }
 }
  • 14. <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org">
 <head>
 <meta charset="utf-8">
 <title>Wicket Example App</title>
 </head>
 <body>
 <wicket:panel>
 <form wicket:id="userUpdateForm">
 <fieldset>
 <legend><wicket:message key="userUpdateTitle"/></legend>
 <input type="text" wicket:id="name"/>
 <input type="password" wicket:id="password"/>
 <input type="password" wicket:id="passwordRepeat"/>
 <p><input type="submit" value="submit" wicket:id="submit"/></p>
 </fieldset>
 </form>
 </wicket:panel>
 </body>
 </html>
  • 18. public class MyUserUpdatePanel extends UserUpdatePanel{
 
 public UserUpdatePanel(String id, IModel<User> model) {
 super(id, model); }
 } <!DOCTYPE html>
 <html xmlns:wicket="http://wicket.apache.org">
 <head>
 <meta charset="utf-8">
 <title>Wicket Example App</title>
 </head>
 <body>
 <wicket:panel>
 <form wicket:id="userUpdateForm">
 <fieldset>
 <legend><wicket:message key="userUpdateTitle"/></legend>
 <input type="text" wicket:id="name"/>
 <input type="password" wicket:id="password"/>
 <input type="password" wicket:id="passwordRepeat"/>
 <p><input type="submit" value="submit" wicket:id="submit"/></p>
 </fieldset>
 </form>
 </wicket:panel>
 </body>
 </html> MyUserUpdatePanel.html MyUserUpdatePanel.properties userUpdateTitle=Lustiges Felderraten
  • 20. MyUserUpdatePanel UserUpdatePanel Object Got my stuff? MyUserUpdatePanel UserUpdatePanel Object Application Markup Properties ... ...
  • 21. Datenbeschaffung package de.bootcamp.wicket.web.page;
 
 public interface IModel<T> extends IDetachable
 {
 T getObject();
 void setObject(final T object);
 } public UserUpdatePanel(String id, IModel<User> model)
  • 22. public class UserUpdatePanel extends Panel{ 
 ! ... 
 
 public UserUpdatePanel(String id, IModel<User> model) {
 super(id, model);
 
 FormComponent<String> password = new PasswordTextField(PASSWORD, new PropertyModel<String>(model, "password") );
 FormComponent<String> passwordRepeat = new PasswordTextField(PASSWORD_REPEAT, Model.of(""));
 
 Form<User> userUpdateForm =
 new Form<User>(USER_UPDATE_FORM, new CompoundPropertyModel<User>(model)) {
 @Override
 protected void onSubmit() {
 userRepository.save(getModelObject());
 }
 }; 
 ... 
 }
 }
  • 23. • Entkopplung Beschaffung /Verwendung! • Lazy! • Chainable! • Leicht testbar IModel
  • 24. Behavior • AttributeAppender/AttributeModifier! • AjaxSelfUpdatingBehavior! • AjaxEventBehavior! • ... Component! Behavior.add( )
  • 26. Page public class HomePage extends WebPage {
 private static final long serialVersionUID = 1L;
 
 @SpringBean
 private BusinessService businessService;
 
 public HomePage(final PageParameters parameters) {
 super(parameters);
 
 IModel<User> userModel = new LoadableDetachableModel<User>() {
 @Override
 protected User load() {
 return businessService.findUserByName("user1");
 }
 };
 add(new Label("name", new PropertyModel<String>(userModel,"name"))); 
 add(new MyUserUpdatePanel("userUpdatePanel", userModel)); ! add(new AjaxLink("adminLink") {
 @Override
 public void onClick(AjaxRequestTarget target) {
 setResponsePage(AdminPage.class);
 }
 });
 }
 }
  • 28. AJAX • Seit Wicket 6: JQuery!! • TransparenteVerwendung! • Maßgeblicher Bestandteil des Wicket-Kerns! • Einfach über Behaviors erweiterbar! • Weiterführung der Komponentisierung
  • 32. Component public interface IEventSource
 {
 <T> void send(IEventSink sink, Broadcast broadcast, T payload);
 } public interface IEventSink
 {
 void onEvent(IEvent<?> event);
 } • Schwache Kopplung! • hohe Flexibilität! • weniger Boilerplate
  • 34. ... @Override
 public void onEvent(IEvent<?> event) {
 if(event.getPayload() instanceof AjaxRequestTarget) {
 ((AjaxRequestTarget)event.getPayload()).add(this);
 }
 }
 ...
  • 35. WicketTester private WicketTester wicketTester;
 
 @Before
 public void setUp() {
 wicketTester = new WicketTester();
 }
 
 @After
 public void tearDown() {
 wicketTester.destroy();
 }
 
 @Test
 public void testCreateTask() throws Exception{
 IModel<TaskList> taskListMock = mock(IModel.class);
 User testUser = new User();
 
 CreateTaskPanel createTaskPanel = new CreateTaskPanel("testPanel", testUser, taskListMock);
 
 wicketTester.startComponentInPage(createTaskPanel);
 wicketTester.assertComponent("testPanel", CreateTaskPanel.class);
 
 FormTester formTester = wicketTester.newFormTester("testPanel:taskForm");
 formTester.setValue("title", "taskTitle");
 formTester.submit();
 
 ArgumentCaptor<Task> taskCaptor = ArgumentCaptor.forClass(Task.class);
 verify(taskServiceMock).create(taskCaptor.capture());
 
 assertEquals("taskTitle", taskCaptor.getValue().getTitle());
 assertEquals(testUser, taskCaptor.getValue().getUser());
 }
  • 36. Ressourcen • JavaScript! • CSS! • Bilder! • PDF! • ...
  • 37. public class DataTablesResource extends JavaScriptResourceReference {
 
 private static final Set<HeaderItem> deps;
 static {
 HashSet<HeaderItem> items = new HashSet<HeaderItem>();
 items.add(JavaScriptHeaderItem.forReference(JQueryResourceReference.get()));
 deps = Collections.unmodifiableSet(items);
 }
 
 private static final DataTablesResource instance = new DataTablesResource();
 private DataTablesResource() {
 super(DataTablesResource.class, "jquery.dataTables.js");
 }
 
 public static DataTablesResource get() {
 return instance;
 }
 
 @Override
 public Iterable<? extends HeaderItem> getDependencies() {
 return deps;
 }
 } ... ! @Override
 public void renderHead(IHeaderResponse response) {
 super.renderHead(response);
 response.render(JavaScriptHeaderItem.forReference(DataTablesResource.get()));
 } ! ...
  • 38. Und weiter? • Optimierung der verwendeten Ressourcen! • Kontrolle der URL! • Dependency Management! • JavaScript ResourceBundles! • Übersteuern vonVersionen