wicket.markup.html
Class WebPage

java.lang.Object
  extended by wicket.Component
      extended by wicket.MarkupContainer
          extended by wicket.Page
              extended by wicket.markup.html.WebPage
All Implemented Interfaces:
java.io.Serializable, IRedirectListener, IRequestListener, INewBrowserWindowListener, IPageMapEntry
Direct Known Subclasses:
AccessDeniedPage, BrowserInfoPage, DummyHomePage, DummyPanelPage, ExceptionErrorPage, InternalErrorPage, PageExpiredErrorPage, PopupCloseLink.ClosePopupPage, RedirectPage

public class WebPage
extends Page
implements INewBrowserWindowListener

Base class for HTML pages. This subclass of Page simply returns HTML when asked for its markup type. It also has a method which subclasses can use to retrieve a bookmarkable link to the application's home page.

WebPages can be constructed with any constructor when they are being used in a Wicket session, but if you wish to link to a Page using a URL that is "bookmarkable" (which implies that the URL will not have any session information encoded in it, and that you can call this page directly without having a session first directly from your browser), you need to implement your Page with a no-arg constructor or with a constructor that accepts a PageParameters argument (which wraps any query string parameters for a request). In case the page has both constructors, the constructor with PageParameters will be used.

Author:
Jonathan Locke, Eelco Hillenius, Juergen Donnerstag, Gwyn Evans
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class wicket.Component
Component.ComponentModelChange, Component.EnabledChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Page
LATEST_VERSION
 
Fields inherited from class wicket.Component
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER
 
Fields inherited from interface wicket.markup.html.INewBrowserWindowListener
INTERFACE
 
Fields inherited from interface wicket.IRedirectListener
INTERFACE
 
Constructor Summary
protected WebPage()
          Constructor.
protected WebPage(IModel model)
           
protected WebPage(PageMap pageMap)
           
protected WebPage(PageMap pageMap, IModel model)
           
protected WebPage(PageParameters parameters)
          Constructor which receives wrapped query string parameters for a request.
 
Method Summary
protected  void configureResponse()
          Set-up response with appropriate content type, locale and encoding.
 BodyContainer getBodyContainer()
          Get a facade to the body container for adding onLoad javascript to the body tag.
 java.lang.String getMarkupType()
          Gets the markup type for a WebPage, which is "html" by default.
 URLCompressor getUrlCompressor()
          This method is called when the compressing coding and response stategies are configured in your Application object like this:
protected  WebRequestCycle getWebRequestCycle()
           
protected  BookmarkablePageLink homePageLink(java.lang.String id)
          Creates and returns a bookmarkable link to this application's home page.
protected  void internalOnAttach()
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
protected  void onDetach()
          Called to allow a component to detach resources after use.
 void onNewBrowserWindow()
          Called when a new browser window is detected.
 
Methods inherited from class wicket.Page
afterCallComponent, beforeCallComponent, checkAccess, detachModels, dirty, endComponentRender, expireOldestVersion, getAutoIndex, getCurrentVersionNumber, getFeedbackMessages, getId, getNumericId, getPageClass, getPageMap, getPageMapEntry, getSizeInBytes, getVersion, getVersions, hierarchyAsString, internalDetach, internalOnDetach, internalOnModelChanged, isErrorPage, moveToPageMap, newVersionManager, onRedirect, onRender, removePersistedFormData, renderPage, setNumericId, startComponentRender, toString
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, internalAdd, internalAttach, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, continueToOriginalDestination, debug, detachBehaviors, detachModel, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getOutputMarkupId, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getString, getString, getString, getStyle, getVariation, hasErrorMessage, hasFeedbackMessage, info, initModel, isActionAuthorized, isAncestorOf, isBehaviorAccepted, isEnableAllowed, isEnabled, isHeadRendered, isIgnoreAttributeModifier, isRenderAllowed, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeforeRender, onBeginRequest, onComponentTag, onEndRequest, onModelChanged, onModelChanging, onRender, redirectToInterceptPage, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderedBehaviors, renderHead, replaceComponentTagBody, replaceWith, resetHeadRendered, sameRootModel, sameRootModel, setAuto, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMetaData, setModelObject, setOutputMarkupId, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wicket.session.pagemap.IPageMapEntry
getPage
 

Constructor Detail

WebPage

protected WebPage()
Constructor. Having this constructor public means that your page is 'bookmarkable' and hence can be called/ created from anywhere.


WebPage

protected WebPage(IModel model)
See Also:
Page.Page(IModel)

WebPage

protected WebPage(PageMap pageMap)
See Also:
Page.Page(PageMap)

WebPage

protected WebPage(PageMap pageMap,
                  IModel model)
See Also:
Page.Page(PageMap, IModel)

WebPage

protected WebPage(PageParameters parameters)
Constructor which receives wrapped query string parameters for a request. Having this constructor public means that your page is 'bookmarkable' and hence can be called/ created from anywhere. For bookmarkable pages (as opposed to when you construct page instances yourself, this constructor will be used in preference to a no-arg constructor, if both exist. Note that nothing is done with the page parameters argument. This constructor is provided so that tools such as IDEs will include it their list of suggested constructors for derived classes.

Parameters:
parameters - Wrapped query string parameters.
Method Detail

internalOnAttach

protected void internalOnAttach()
Description copied from class: Component
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL OR OVERRIDE. Called when a request begins.

Overrides:
internalOnAttach in class Component
See Also:
Component.internalOnAttach()

getBodyContainer

public BodyContainer getBodyContainer()
Get a facade to the body container for adding onLoad javascript to the body tag.

Returns:
The body container

getMarkupType

public java.lang.String getMarkupType()
Gets the markup type for a WebPage, which is "html" by default. Support for pages in another markup language, such as VXML, would require the creation of a different Page subclass in an appropriate package under wicket.markup. To support VXML (voice markup), one might create the package wicket.markup.vxml and a subclass of Page called VoicePage.

Note: The markup type must be equal to the extension of the markup file. In the case of WebPages, it must always be "html".

Overrides:
getMarkupType in class MarkupContainer
Returns:
Markup type for HTML

configureResponse

protected void configureResponse()
Description copied from class: Page
Set-up response with appropriate content type, locale and encoding. The locale is set equal to the session's locale. The content type header contains information about the markup type (@see #getMarkupType()) and the encoding. The response (and request) encoding is determined by an application setting (@see ApplicationSettings#getResponseRequestEncoding()). In addition, if the page's markup contains a xml declaration like <?xml ... ?> an xml declaration with proper encoding information is written to the output as well, provided it is not disabled by an applicaton setting (@see ApplicationSettings#getStripXmlDeclarationFromOutput()).

Note: Prior to Wicket 1.1 the output encoding was determined by the page's markup encoding. Because this caused uncertainties about the /request/ encoding, it has been changed in favour of the new, much safer, approach. Please see the Wiki for more details.

Overrides:
configureResponse in class Page
See Also:
Page.configureResponse()

getWebRequestCycle

protected final WebRequestCycle getWebRequestCycle()
Returns:
The WebRequestCycle for this WebPage.

homePageLink

protected final BookmarkablePageLink homePageLink(java.lang.String id)
Creates and returns a bookmarkable link to this application's home page.

Parameters:
id - Name of link
Returns:
Link to home page for this application

getUrlCompressor

public final URLCompressor getUrlCompressor()
This method is called when the compressing coding and response stategies are configured in your Application object like this:
 protected IRequestCycleProcessor newRequestCycleProcessor()
 {
        return new CompoundRequestCycleProcessor(new WebURLCompressingCodingStrategy(),
                        new WebURLCompressingTargetResolverStrategy(), null, null, null);
 }
 

Returns:
The URLCompressor for this webpage.
Since:
1.2
See Also:
WebURLCompressingCodingStrategy, WebURLCompressingTargetResolverStrategy, URLCompressor

onDetach

protected void onDetach()
Description copied from class: Component
Called to allow a component to detach resources after use. The semantics of this will be tightened in Wicket 1.3 when we will add the guarantee that onDetach() be called after all framework use of a Component (in the implementation of request targets).

Overrides:
onDetach in class Component
See Also:
Component.onDetach()

onNewBrowserWindow

public void onNewBrowserWindow()
Description copied from interface: INewBrowserWindowListener
Called when a new browser window is detected.

Specified by:
onNewBrowserWindow in interface INewBrowserWindowListener
See Also:
INewBrowserWindowListener.onNewBrowserWindow()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.