|
|||||||||||
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
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, such as error page classes appropriate for HTML. WebApplication subclasses can override these values and/or modify other application settings in their respective constructors by calling getSettings() to retrieve a mutable ApplicationSettings object.
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
,
ApplicationSettings
,
ApplicationPages
Constructor Summary | |
WebApplication()
Constructor. |
Method Summary | |
void |
addRedirect(javax.servlet.http.HttpServletRequest request,
java.lang.String requestUri,
BufferedResponse renderedResponse)
|
ApplicationSettings |
createApplicationSettings()
Subclasses could override this to give there own implementation of ApplicationSettings. |
BufferedResponse |
getBufferedResponse(javax.servlet.http.HttpServletRequest request,
java.lang.String requestUri)
Returns the redirect map where the buffered render pages are stored in. |
(package private) WebSession |
getSession(WebRequest request,
boolean create)
Gets a WebSession object from the HttpServletRequest, creating a new one if it doesn't already exist. |
protected ISessionFactory |
getSessionFactory()
|
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. |
protected WebRequest |
newWebRequest(javax.servlet.http.HttpServletRequest servletRequest)
Create a new WebRequest. |
protected WebResponse |
newWebResponse(javax.servlet.http.HttpServletResponse servletResponse)
Create a WebResponse. |
void |
setSessionFactory(ISessionFactory sessionFactory)
|
void |
setWicketServlet(WicketServlet wicketServlet)
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. |
Methods inherited from class wicket.Application |
addResourceFactory, get, getComponentResolvers, getConverterFactory, getLocalizer, getMarkupCache, getName, getPages, getPageSets, getResourceFactory, getResourceStreamLocator, getResourceWatcher, getSettings, getSharedResources, newCrypt, newMarkupParser, onRuntimeException, set, setLocalizer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WebApplication()
Method Detail |
public final WicketServlet getWicketServlet()
public 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.protected ISessionFactory getSessionFactory()
getSessionFactory
in class Application
Application.getSessionFactory()
protected void init()
init
in class Application
protected void internalInit()
internalInit
in class Application
protected void internalDestroy()
final WebSession getSession(WebRequest request, boolean create)
request
- The http request objectcreate
- Should the session be created if not there.
protected WebRequest newWebRequest(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest
-
protected WebResponse newWebResponse(javax.servlet.http.HttpServletResponse servletResponse)
servletResponse
-
public BufferedResponse getBufferedResponse(javax.servlet.http.HttpServletRequest request, java.lang.String requestUri)
request
- requestUri
-
public void addRedirect(javax.servlet.http.HttpServletRequest request, java.lang.String requestUri, BufferedResponse renderedResponse)
request
- requestUri
- renderedResponse
- public ApplicationSettings createApplicationSettings()
createApplicationSettings
in class Application
Application.createApplicationSettings()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |