wicket.markup.html
Class WebPage

java.lang.Object
  extended bywicket.Component
      extended bywicket.MarkupContainer
          extended bywicket.Page
              extended bywicket.markup.html.WebPage
All Implemented Interfaces:
IFeedbackBoundary, IRedirectListener, IRequestListener, java.io.Serializable
Direct Known Subclasses:
ExceptionErrorPage, InternalErrorPage, PageExpiredErrorPage, RedirectPage

public class WebPage
extends Page

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
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class wicket.Component
Component.ComponentModelChange, Component.IVisitor, Component.VisibilityChange
 
Field Summary
 
Fields inherited from class wicket.Page
ACCESS_ALLOWED, ACCESS_DENIED
 
Fields inherited from class wicket.Component
FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4
 
Constructor Summary
protected WebPage()
          Constructor.
protected WebPage(IModel model)
           
 
Method Summary
 java.lang.String getMarkupType()
          Gets the markup type for a WebPage, which is "html" by default.
protected  WebRequestCycle getWebRequestCycle()
           
protected  BookmarkablePageLink homePageLink(java.lang.String id)
          Creates and returns a bookmarkable link to this application's home page.
 java.lang.String urlFor(Component component, java.lang.Class listenerInterface)
          Returns a URL that references a given interface on a component.
 java.lang.String urlFor(java.lang.String path)
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
 java.lang.String urlFor(java.lang.String pageMapName, java.lang.Class pageClass, PageParameters parameters)
          Returns a bookmarkable URL that references a given page class using a given set of page parameters.
 
Methods inherited from class wicket.Page
checkAccess, configureResponse, continueToOriginalDestination, doRender, getAutoIndex, getCurrentVersionNumber, getFeedbackMessages, getPageMap, getPageSets, getVersion, hierarchyAsString, internalOnEndRequest, internalOnModelChanged, isDirty, isErrorPage, newPageState, newVersionManager, onRedirect, onRender, redirectToInterceptPage, removePersistedFormData, setDirty, setPageMap, toString
 
Methods inherited from class wicket.MarkupContainer
add, autoAdd, contains, findMarkupStream, get, getMarkupStream, internalAdd, internalBeginRequest, internalEndRequest, iterator, onComponentTagBody, remove, removeAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, visitChildren, visitChildren
 
Methods inherited from class wicket.Component
add, addStateChange, checkComponentTag, checkComponentTagAttribute, debug, detachModel, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getApplicationPages, getApplicationSettings, getClassRelativePath, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getId, getLocale, getLocalizer, getModel, getModelObject, getModelObjectAsString, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResource, getResponse, getSession, getString, getString, getString, getStyle, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnBeginRequest, internalOnModelChanging, isAncestorOf, isVersioned, isVisible, isVisibleInHierarchy, modelChanged, modelChanging, newPage, newPage, onBeginRequest, onComponentTag, onEndRequest, onModelChanged, onModelChanging, onSessionAttach, redirectTo, remove, render, renderComponent, renderComponentTag, rendered, replaceComponentTagBody, sameRootModel, sameRootModel, setFlag, setModelObject, setRedirect, setRenderBodyOnly, setResponsePage, setShouldEscapeModelStrings, setVersioned, setVisible, urlFor, visitParents, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebPage

protected WebPage()
Constructor.


WebPage

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

urlFor

public java.lang.String urlFor(java.lang.String pageMapName,
                               java.lang.Class pageClass,
                               PageParameters parameters)
Returns a bookmarkable URL that references a given page class using a given set of page parameters. Since the URL which is returned contains all information necessary to instantiate and render the page, it can be stored in a user's browser as a stable bookmark.

Specified by:
urlFor in class Page
Parameters:
pageMapName - Name of pagemap to use
pageClass - Class of page
parameters - Parameters to page
Returns:
Bookmarkable URL to page

urlFor

public java.lang.String urlFor(Component component,
                               java.lang.Class listenerInterface)
Returns a URL that references a given interface on a component. When the URL is requested from the server at a later time, the interface will be called. A URL returned by this method will not be stable across sessions and cannot be bookmarked by a user.

Specified by:
urlFor in class Page
Parameters:
component - The component to reference
listenerInterface - The listener interface on the component
Returns:
A URL that encodes a page, component and interface to call

urlFor

public java.lang.String urlFor(java.lang.String path)
Description copied from class: Page
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT.

Specified by:
urlFor in class Page
Parameters:
path - The path
Returns:
The url for the path

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

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


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