|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wicket.Application wicket.protocol.http.WebApplication
public abstract class WebApplication
A web application is a subclass of Application which associates with an instance of WicketServlet to serve pages over the HTTP protocol. This class is intended to be subclassed by framework clients to define a web application.
Application settings are given defaults by the WebApplication() constructor and internalInit method, such as error page classes appropriate for HTML. WebApplication subclasses can override these values and/or modify other application settings by overriding the init() method and then by calling getXXXSettings() to retrieve an interface to a mutable Settings object. Do not do this in the constructor itself because the defaults will then override your settings.
If you want to use servlet specific configuration, e.g. using init parameters
from the ServletConfig
object, you should override the
init() method. For example:
public void init() { String webXMLParameter = getWicketServlet().getInitParameter("myWebXMLParameter"); URL schedulersConfig = getWicketServlet().getServletContext().getResource("/WEB-INF/schedulers.xml"); ...
WicketServlet
,
IApplicationSettings
,
IDebugSettings
,
IExceptionSettings
,
IMarkupSettings
,
IPageSettings
,
IRequestCycleSettings
,
IResourceSettings
,
ISecuritySettings
,
ISessionSettings
Field Summary |
---|
Fields inherited from class wicket.Application |
---|
CONFIGURATION, CONTEXTPATH, DEPLOYMENT, DEVELOPMENT |
Constructor Summary | |
---|---|
WebApplication()
Constructor. |
Method Summary | |
---|---|
java.lang.String |
getApplicationKey()
Gets the unique key of this application within a given context (like a web application). |
protected IRequestCycleFactory |
getDefaultRequestCycleFactory()
Create a request cycle factory which is used by default by WebSession. |
IRequestCycleProcessor |
getRequestCycleProcessor()
Gets the default request cycle processor (with lazy initialization). |
RequestLogger |
getRequestLogger()
Gets the RequestLogger . |
java.lang.String |
getSessionAttributePrefix(WebRequest request)
Gets the prefix for storing variables in the actual session (typically HttpSession for this application instance. |
protected ISessionFactory |
getSessionFactory()
Gets the factory for creating session instances. |
WicketServlet |
getWicketServlet()
|
protected void |
init()
Initialize; if you need the wicket servlet for initialization, e.g. |
protected void |
internalDestroy()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
protected void |
internalInit()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
logEventTarget(IRequestTarget target)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
logResponseTarget(IRequestTarget target)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
mount(java.lang.String path,
IRequestTargetUrlCodingStrategy encoder)
Mounts an encoder at the given path. |
void |
mount(java.lang.String path,
PackageName packageName)
Mounts all bookmarkable pages at the given path. |
void |
mountBookmarkablePage(java.lang.String path,
java.lang.Class bookmarkablePageClass)
Mounts a bookmarkable page class to the given path. |
void |
mountBookmarkablePage(java.lang.String path,
PageMap pageMap,
java.lang.Class bookmarkablePageClass)
Deprecated. You won't be able to use this mount. Use mountBookmarkablePage(String, String, Class) instead |
void |
mountBookmarkablePage(java.lang.String path,
java.lang.String pageMapName,
java.lang.Class bookmarkablePageClass)
Mounts a bookmarkable page class to the given pagemap and path. |
void |
mountSharedResource(java.lang.String path,
java.lang.String resourceKey)
Mounts a shared resource class to the given path. |
protected IRequestCycleProcessor |
newRequestCycleProcessor()
May be replaced by subclasses which whishes to uses there own implementation of IRequestCycleProcessor |
Session |
newSession()
Create new Wicket Session object. |
protected ISessionStore |
newSessionStore()
Creates a new session facade. |
protected WebRequest |
newWebRequest(javax.servlet.http.HttpServletRequest servletRequest)
Create a new WebRequest. |
protected WebResponse |
newWebResponse(javax.servlet.http.HttpServletResponse servletResponse)
Create a WebResponse. |
void |
sessionDestroyed(java.lang.String sessionId)
|
protected void |
setApplicationKey(java.lang.String applicationKey)
|
void |
setRequestLogger(RequestLogger logger)
Sets the RequestLogger . |
void |
setSessionFactory(ISessionFactory sessionFactory)
|
void |
setWicketServlet(WicketServlet wicketServlet)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
void |
unmount(java.lang.String path)
Unmounts whatever encoder is mounted at a given path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebApplication()
init()
for any configuration of your
application instead of overriding the constructor.
Method Detail |
---|
public final java.lang.String getApplicationKey()
Application
getApplicationKey
in class Application
Application.getApplicationKey()
public final IRequestCycleProcessor getRequestCycleProcessor()
IRequestCycleProcessor
that will be used by
RequestCycle
s when custom implementations of the request cycle
do not provide their own customized versions.
public final RequestLogger getRequestLogger()
RequestLogger
.
public final java.lang.String getSessionAttributePrefix(WebRequest request)
HttpSession
for this application instance.
request
- the request
public final WicketServlet getWicketServlet()
public void logEventTarget(IRequestTarget target)
Application
logEventTarget
in class Application
Application.logEventTarget(wicket.IRequestTarget)
public void logResponseTarget(IRequestTarget target)
Application
logResponseTarget
in class Application
Application.logResponseTarget(wicket.IRequestTarget)
public final void mount(java.lang.String path, IRequestTargetUrlCodingStrategy encoder)
path
- the path to mount the encoder onencoder
- the encoder that will be used for this mountpublic final void mount(java.lang.String path, PackageName packageName)
path
- the path to mount the bookmarkable page class onpackageName
- the name of the package for which all bookmarkable pages or
sharedresources should be mountedpublic final void mountBookmarkablePage(java.lang.String path, java.lang.Class bookmarkablePageClass)
path
- the path to mount the bookmarkable page class onbookmarkablePageClass
- the bookmarkable page class to mountpublic final void mountBookmarkablePage(java.lang.String path, PageMap pageMap, java.lang.Class bookmarkablePageClass)
mountBookmarkablePage(String, String, Class)
instead
path
- the path to mount the bookmarkable page class onpageMap
- pagemap this mount is forbookmarkablePageClass
- the bookmarkable page class to mountpublic final void mountBookmarkablePage(java.lang.String path, java.lang.String pageMapName, java.lang.Class bookmarkablePageClass)
path
- the path to mount the bookmarkable page class onpageMapName
- name of the pagemap this mount is forbookmarkablePageClass
- the bookmarkable page class to mountpublic final void mountSharedResource(java.lang.String path, java.lang.String resourceKey)
path
- the path to mount the bookmarkable page class onresourceKey
- the shared key of the resource being mountedpublic Session newSession()
newSession
in interface ISessionFactory
ISessionFactory.newSession()
public void sessionDestroyed(java.lang.String sessionId)
sessionId
- The session id that was destroyedpublic final void setRequestLogger(RequestLogger logger)
RequestLogger
.
logger
- The request loggerpublic final void setSessionFactory(ISessionFactory sessionFactory)
sessionFactory
- The session factory to usepublic final void setWicketServlet(WicketServlet wicketServlet)
wicketServlet
- The wicket servlet instance for this application
java.lang.IllegalStateException
- If an attempt is made to call this method once the wicket
servlet has been set for the application.public final void unmount(java.lang.String path)
path
- the path of the encoder to unmountprotected IRequestCycleFactory getDefaultRequestCycleFactory()
WebSession.getRequestCycleFactory()
,
IRequestCycleFactory
protected ISessionFactory getSessionFactory()
Application
getSessionFactory
in class Application
Application.getSessionFactory()
protected void init()
init
in class Application
protected void internalDestroy()
internalDestroy
in class Application
protected void internalInit()
<init-param><param-name>configuration</param-name>
).
If not found check the servlet context init paramert
<context-param><param-name6gt;configuration</param-name>
).
If the parameter is "development" (which is default), settings
appropriate for development are set. If it's "deployment" , deployment
settings are used. If development is specified and a "sourceFolder" init
parameter is also set, then resources in that folder will be polled for
changes.
internalInit
in class Application
protected IRequestCycleProcessor newRequestCycleProcessor()
protected ISessionStore newSessionStore()
Application
newSessionStore
in class Application
Application.newSessionStore()
protected WebRequest newWebRequest(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest
-
protected WebResponse newWebResponse(javax.servlet.http.HttpServletResponse servletResponse)
servletResponse
-
protected final void setApplicationKey(java.lang.String applicationKey)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |