@ThreadRestricted(value="wicket") public abstract class VPage extends WebPage
Access to pages, components and their models is restricted to Wicket threads. This
restriction is documented by the annotation @ThreadRestricted("wicket")
. Runtime enforcement of compliance is not
possible, e.g. by the use of assertions, because Wicket threads are synchronized
through a locking mechanism that is private to Wicket.
See www.nabble.com/Thread-safety-for-components-to17265324.
Note that when Wicket's form processor (1.3.2) is accessing a field, it has the habit of bypassing accessor methods and reading/writing the field directly, even if it happens to be declared private. To prevent this, ensure that any field a form might want to access is provided with an accessor method that is declared public (package is not suffient).
Numeric version parameters were added to the URL of each stateful page in 1.5. The standard workaround for avoiding these is to make the page stateless. (Use StatelessComponent to enable debugging of this in development mode.) Constructors and onClick() handlers for stateless pages need careful design, otherwise servicing a single click may require a heavy reconstruction of the page.
Modifier and Type | Field and Description |
---|---|
static int |
SHORT_STRING_LENGTH_MAX
The maximum length of a 'short string', in characters.
|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER
INTERFACE
Modifier | Constructor and Description |
---|---|
protected |
VPage()
Constructs a VPage, per WebPage().
|
protected |
VPage(PageParameters _pP)
Constructs a VPage, per WebPage(_pP).
|
Modifier and Type | Method and Description |
---|---|
static WicEmailAddressValidator |
emailAddressValidator()
A shared instance of a validator for strict email addresses.
|
static MaxLengthValidator |
inputLengthValidator()
A shared instance of a validator for standard input length.
|
static Fragment |
newBodyOnlyFragment(String id,
String markupID,
MarkupContainer markupProvider)
Constructs a fragment that renders only its body, no tags.
|
static MarkupContainer |
newNullComponent(String id)
Constructs a component that is invisible and does nothing.
|
static String |
shortened(String string)
Returns a version of the string that is truncated to SHORT_STRING_LENGTH_MAX characters.
|
static String |
shortenedWords(String string)
Returns a version of the string, in which each of the whitespace delimited words
is truncated to SHORT_STRING_LENGTH_MAX
characters; or the same string, if no truncation is required.
|
static String |
stringNonEmpty(PageParameters pP,
String key)
Retrieves a null or non-empty string value by key.
|
static String |
stringRequired(PageParameters pP,
String key)
Retrieves a non-null, non-empty string value by key.
|
protected VOWicket |
vApplication() |
protected VRequestCycle |
vRequestCycle() |
configureResponse, dirty, getMarkupType, homePageLink, onAfterRender, onRender, renderXmlDecl, setHeaders
componentChanged, componentRendered, detachModels, dirty, endComponentRender, getAutoIndex, getId, getPageClass, getPageId, getPageParameters, getPageReference, getRenderCount, getSizeInBytes, getStatelessHint, hierarchyAsString, internalOnModelChanged, internalPrepareForRender, isBookmarkable, isErrorPage, isPageStateless, onBeforeRender, onDetach, onRedirect, renderPage, setFreezePageId, setNumericId, setStatelessHint, setWasCreatedBookmarkable, startComponentRender, toString, wasCreatedBookmarkable, wasRendered
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onMarkupAttached, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, visitChildren, visitChildren, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFeedbackMessages, getFlag, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onComponentTag, onConfigure, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canCallListenerInterface, detach, get, getBehaviorById, getBehaviorId, getPage, getPageRelativePath
detach
public static final int SHORT_STRING_LENGTH_MAX
protected VPage(PageParameters _pP)
public static WicEmailAddressValidator emailAddressValidator()
public static MaxLengthValidator inputLengthValidator()
VoterInputTable.MAX_INPUT_LENGTH
public static Fragment newBodyOnlyFragment(String id, String markupID, MarkupContainer markupProvider)
public static MarkupContainer newNullComponent(String id)
@ThreadSafe public static String shortened(String string)
@ThreadSafe public static String shortenedWords(String string)
public static String stringNonEmpty(PageParameters pP, String key)
RestartResponseException
- if the value is the empty string "", and
registers an error with the session.HTTPServletRequestX.getParameterNonEmpty(String,javax.servlet.ServletRequest)
public static String stringRequired(PageParameters pP, String key)
RestartResponseException
- if the value cannot be retrieved, and registers
an error with the session.HTTPServletRequestX.getParameterRequired(String,javax.servlet.ServletRequest)
protected final VOWicket vApplication()
Component.getApplication()
protected final VRequestCycle vRequestCycle()