Apache Wicket is constantly growing in popularity throughout all kinds of projects. However Wicket doesn't come out of the box with a built-in Java EE support. Integration to CDI is missing and the same is valid for Bean Validation support for example. This session demonstrates how you can user CDI, Conversations and Bean Validation together with Apache Wicket. The first part of the talk will consist of a small slide-driven theoretical part whereas the second part will consist of a coding session that demonstrates hands-on how to hook everything together.
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Integrating Wicket with Java EE 6
1. Wicket + JEE 6
Michael Plöd
Senacor Technologies AG
2. Agenda
• Brief Wicket Intro
• Standard Wicket - Spring App
• Integrating Wicket and EJB with CDI
• Integrating Wicket and Bean Validation
• Coding Example
14. public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
add(new Label("message",
"If you see this message wicket is
properly configured and running"));
}
}
<html xmlns:wicket=
"http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" >
<head>
<title>Wicket Quickstart Archetype Homepage</title>
</head>
<body>
<strong>Wicket Quickstart Archetype Homepage</strong>
<br/><br/>
<span wicket:id="message">message will be here</span>
</body>
</html>
16. Spring JEE
<span wicket:id="message">message will be here</span>
add(new Label("message",
"If you see this message wicket is
properly configured and running"));
17. Typical Wicket
Wicket - Spring @SpringBean
Application
<Service>
Spring Bean
@Autowired
<Repository>
Spring Bean
18. public class HomePage extends WebPage {
@SpringBean
private PersonService personService;
private class PersonListModel
extends LoadableDetachableModel<List<Person>> {
@Override
protected List<Person> load() {
return personService.listPersons();
}
}
public HomePage(final PageParameters parameters) {
...
final PropertyListView<Person> list =
new PropertyListView<Person>("persons", new PersonListModel()) {
...
}
};
...
25. public class HomePage extends WebPage {
@Inject
private PersonService personService;
private class PersonListModel
extends LoadableDetachableModel<List<Person>> {
@Override
protected List<Person> load() {
return personService.listPersons();
}
}
public HomePage(final PageParameters parameters) {
...
final PropertyListView<Person> list =
new PropertyListView<Person>("persons", new PersonListModel()) {
...
}
};
...
26. „Programming today is a race
between software engineers striving
to build bigger and better idiot-proof
programs, and the universe trying to
build bigger and better idiots.
So far, the universe is winning.“
-- Robert Cringely --