| javax.servlet.http.HttpServlet wicket.protocol.http.WicketServlet
All known Subclasses: wicket.protocol.http.portlet.WicketPortletServlet,
WicketServlet | public class WicketServlet extends HttpServlet (Code) | | Servlet class for all wicket applications. The specific application class to
instantiate should be specified to the application server via an init-params
argument named "applicationClassName" in the servlet declaration, which is
typically in a web.xml file. The servlet declaration may vary from
one application server to another, but should look something like this:
<servlet>
<servlet-name>MyApplication</servlet-name>
<servlet-class>wicket.protocol.http.WicketServlet</servlet-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.whoever.MyApplication</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Note that the applicationClassName parameter you specify must be the fully
qualified name of a class that extends WebApplication. If your class cannot
be found, does not extend WebApplication or cannot be instantiated, a runtime
exception of type WicketRuntimeException will be thrown.
As an alternative, you can configure an application factory instead. This
looks like:
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>teachscape.platform.web.wicket.SpringApplicationFactory</param-value>
</init-param>
and it has to satisfy interface
wicket.protocol.http.IWebApplicationFactory .
When GET/POST requests are made via HTTP, an WebRequestCycle object is
created from the request, response and session objects (after wrapping them
in the appropriate wicket wrappers). The RequestCycle's render() method is
then called to produce a response to the HTTP request.
If you want to use servlet specific configuration, e.g. using init parameters
from the
javax.servlet.ServletConfig object, you should override the
init() method of
javax.servlet.GenericServlet . For example:
public void init() throws ServletException
{
ServletConfig config = getServletConfig();
String webXMLParameter = config.getInitParameter("myWebXMLParameter");
...
In order to support frameworks like Spring, the class is non-final and the
variable webApplication is protected instead of private. Thus subclasses may
provide there own means of providing the application object.
See Also: wicket.RequestCycle author: Jonathan Locke author: Timur Mehrvarz author: Juergen Donnerstag author: Igor Vaynberg (ivaynberg) |
APP_FACT_PARAM | final public static String APP_FACT_PARAM(Code) | | The name of the context parameter that specifies application factory
class
|
destroy | public void destroy()(Code) | | Servlet cleanup.
|
getApplicationFactory | protected IWebApplicationFactory getApplicationFactory()(Code) | | Creates the web application factory instance.
If no APP_FACT_PARAM is specified in web.xml
ContextParamWebApplicationFactory will be used by default.
See Also: ContextParamWebApplicationFactory application factory instance |
init | public void init()(Code) | | Servlet initialization
|
Methods inherited from javax.servlet.http.HttpServlet | protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) protected long getLastModified(HttpServletRequest req)(Code)(Java Doc) protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc) public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)
|
|
|