HOME

TheInfoList



OR:

Apache Wicket, commonly referred to as Wicket, is a component-based
web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
for the
Java programming language Java is a high-level, general-purpose, memory-safe, object-oriented programming language. It is intended to let programmers ''write once, run anywhere'' ( WORA), meaning that compiled Java code can run on all platforms that support Jav ...
conceptually similar to
JavaServer Faces Jakarta Faces, formerly Jakarta Server Faces and JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It was formalized as a standard through the Java Community Process as part of the ...
and
Tapestry Tapestry is a form of Textile arts, textile art which was traditionally Weaving, woven by hand on a loom. Normally it is used to create images rather than patterns. Tapestry is relatively fragile, and difficult to make, so most historical piece ...
. It was originally written by Jonathan Locke in April 2004. Version 1.0 was released in June 2005. It graduated into an
Apache The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
top-level project in June 2007.


Rationale

Traditional model-view-controller (MVC) frameworks work in terms of whole
requests Request may refer to: * a question, a request for information * a petition, a formal document demanding something that is submitted to an authority. Request may also refer to: Computing and technology * in computer science, a message sent be ...
and whole pages. In each request cycle, the incoming request is mapped to a method on a ''controller'' object, which then generates the outgoing response in its entirety, usually by pulling data out of a ''model'' to populate a ''view'' written in specialized template markup. This keeps the application's flow-of-control simple and clear, but can make
code reuse Code reuse is the practice of using existing source code to develop software instead of writing new code. ''Software reuse'' is a broader term that implies using any existing software asset to develop software instead of developing it again. An as ...
in the controller difficult. In contrast, Wicket is closely patterned after stateful GUI frameworks such as Swing. Wicket applications are trees of ''components'', which use listener delegates to react to
HTTP HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
requests against links and forms in the same way that Swing components react to mouse and keystroke events. Wicket is categorized as a component-based framework.


Design

Wicket uses plain
XHTML Extensible HyperText Markup Language (XHTML) is part of the family of XML markup languages which mirrors or extends versions of the widely used HyperText Markup Language (HTML), the language in which Web pages are formulated. While HTML, pr ...
for templating (which enforces a clear separation of presentation and
business logic In computer software, business logic or domain logic is the part of the program that encodes the real-world business rules that determine how data can be created, stored, and changed. It is contrasted with the remainder of the software that might ...
and allows templates to be edited with conventional
WYSIWYG In computing, WYSIWYG ( ), an acronym for what you see is what you get, refers to software that allows content to be edited in a form that resembles its appearance when printed or displayed as a finished product, such as a printed document, web ...
design tools). Each component is bound to a named element in the XHTML and becomes responsible for rendering that element in the final output. The ''page'' is simply the top-level containing component and is paired with exactly one XHTML template. Using a special tag, a group of individual components may be abstracted into a single component called a ''panel'', which can then be reused whole in that page, other pages, or even other panels. Each component is backed by its own model, which represents the state of the component. The framework does not have knowledge of how components interact with their models, which are treated as
opaque Opacity is the measure of impenetrability to electromagnetic or other kinds of radiation, especially visible light. In radiative transfer, it describes the absorption and scattering of radiation in a medium, such as a plasma, dielectric, shie ...
objects automatically serialized and persisted between requests. More complex models, however, may be made ''detachable'' and provide hooks to arrange their own storage and restoration at the beginning and end of each request cycle. Wicket does not mandate any particular object-persistence or ORM layer, so applications often use some combination of
Hibernate Hibernation is a state of minimal activity and metabolic reduction entered by some animal species. Hibernation is a seasonal heterothermy characterized by low body-temperature, slow breathing and heart-rate, and low metabolic rate. It is most ...
objects, EJBs or POJOs as models. In Wicket, all server side state is automatically managed. You should never directly use an HttpSession object or similar wrapper to store state. Instead, state is associated with components. Each server-side page component holds a nested hierarchy of stateful components, where each component's model is, in the end, a POJO (Plain Old Java Object) Wicket aims for simplicity. There are no configuration files to learn in Wicket. Wicket is a simple class library with a consistent approach to component structure.


Example

A
Hello World Hello World may refer to: * "Hello, World!" program, a computer program that outputs or displays the message "Hello, World!" Music * "Hello World!" (composition), song by the Iamus computer * "Hello World" (Tremeloes song), 1969 * "Hello World" ...
Wicket application, with four files: ; HelloWorld.html : The XHTML template. Message goes here ; HelloWorld.java : The page component that will be bound to the template. It, in turn, binds a child component (the Label component named "message"). package org.wikipedia.wicket; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; public class HelloWorld extends WebPage ; HelloWorldApplication.java : The main application class, which routes requests for the homepage to the HelloWorld page component. package org.wikipedia.wicket; import org.apache.wicket.protocol.http.WebApplication; public class HelloWorldApplication extends WebApplication ; web.xml : The
servlet A Jakarta Servlet, formerly Java Servlet is a Java software component that extends the capabilities of a server. Although servlets can respond to many types of requests, they most commonly implement web containers for hosting web applicat ...
application Deployment Descriptor, which installs Wicket as the default handler for the servlet and arranges for HelloWorldApplication to be instantiated at startup. Wicket Example HelloWorldApplication org.apache.wicket.protocol.http.WicketFilter applicationClassName org.wikipedia.wicket.HelloWorldApplication HelloWorldApplication /*


Components

Basic components like form, links, repeaters, and so on are built-in.


Releases


See also

*
Vaadin Vaadin () is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the ...
*
Tapestry Tapestry is a form of Textile arts, textile art which was traditionally Weaving, woven by hand on a loom. Normally it is used to create images rather than patterns. Tapestry is relatively fragile, and difficult to make, so most historical piece ...
* Click * ZK * Richfaces *
Echo In audio signal processing and acoustics, an echo is a reflection of sound that arrives at the listener with a delay after the direct sound. The delay is directly proportional to the distance of the reflecting surface from the source and the lis ...


References

* * * * *


Notes


External links

{{Authority control Java enterprise platform Free software programmed in Java (programming language) Web frameworks
Wicket In the sport of cricket, the term wicket has several meanings: * It is either of the two sets of three Stump (cricket), stumps and two Bail (cricket), bails at each end of the Cricket pitch, pitch. The Fielding (cricket), fielding team's playe ...