Wicket in 60 Minutes Wicket 4 Newbs
Even Voorstellen...
AgendaAgenda Waarom Wicket? Basis Ingredienten Wicket Applicatie Demo: Hello World! met Maven en Wicket Demo: Wicked Bookstore Enkele Wicket Componenten
Waarom Wicket? (Hadden nog niet genoeg web frameworks?)
Jawel... EchoCocoonMaverick StrutsTurbineWebWork GWTTapestryClick SmileJappleSpring MVC SOFIAJatoTeaServlet JFormularStripesMelati ExpressoJPublish...
Maar Wicket... Is Component Oriented Houd HTML en Java Strikt Gescheiden Heeft Geen XML configuratie nodig!
Wicket is Component Oriented Composite Pattern
Wicket is Component Oriented Voorbeeld: Form Components
Java en HTML Gescheiden HTML mark-up: famous quote here Java code: String quoteNeilArmstrong= ”This is one small step for a man, “ + “one giant leap for mankind."; add(new Label("quoteOfDay", quoteNeilArmstrong));
Geen XML Configuraties Meer! <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" " (...) <action path="/login" type="test.struts.LoginAction" > (...)
Wat gaat er in de soep? Wicket Basis Ingredienten
Wicket dependency in pom.xml Wicket Servlet Filter in web.xml WebApplication class WebPage class HTML template ( + CSS )
Dependencies in pom.xml org.apache.wicket wicket ${wicket.version} Wicket ‘core’ library: org.apache.wicket wicket-spring ${wicket.version} Wicket Spring integratie library:
Servlet Filter in web.xml wicket.helloworld org.apache.wicket.protocol.http.WicketFilter applicationClassName nl.iprofs.MyWicketApplication wicket.helloworld /*
WebApplication Class package nl.iprofs; import org.apache.wicket.protocol.http.WebApplication; public class WicketApplication extends WebApplication { public MyWicketApplication() {} public Class getHomePage() { return HomePage.class; }
WebPage Class package nl.iprofs; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.WebPage; public class HomePage extends WebPage { public HomePage(final PageParameters parameters) { String neilArmstrongQuote = "This is one small step for a man, " + "one giant leap for mankind"; add( new Label("quoteOfDay", neilArmstrongQuote)); }
HTML Template Quote of the Day Quote of the Day famous quote here
Demo Hello Wicked World
Wicket Componenten
Wicket Component Structuur
Link Component HTML mark-up: Home Java code: Link homeLink = new BookmarkablePageLink("homeLink", HomePage.class);
ListView Component HTML mark-up: Boek A Java code: add(new ListView("categoryRow", categorieen) protected void populateItem(ListItem item) { Category category = (Category) item.getModelObject(); Link catLink = new BookmarkablePageLink( "catLink", HomePage.class); catLink.add(new Label("catLabel", category.getName())); item.add(catLink); } });
Demo WickedBookstore
Vragen... en antwoorden