<servlet> <servlet-name>MyApplication</servlet-name> <servlet-class>org.apache.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 {@link org.apache.wicket.protocol.http.IWebApplicationFactory}.
When GET/POST requests are made via HTTP, a 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 {@link javax.servlet.ServletConfig}object, you should override the init() method of {@link 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 their own means of providing the application object. @see org.apache.wicket.RequestCycle @author Jonathan Locke @author Timur Mehrvarz @author Juergen Donnerstag @author Igor Vaynberg (ivaynberg) @author Al Maw
|
|