package wicket.webapp;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import wicket.ISessionFactory;
import wicket.Session;
import wicket.protocol.http.WebApplication;
import wicket.webapp.pages.*;
import wicket.webapp.service.PersistanceService;
import wicket.webapp.service.PersistanceServiceImpl;
/**
* Application object for your web application. If you want to run this application without deploying, run the Start class.
*
* @see wicket.webapp.pages.Start#main(String[])
*/
public class WebAppMain extends WebApplication
{
/** Logging */
private static final Log log = LogFactory.getLog(WebAppMain.class);
private PersistanceService service = new PersistanceServiceImpl();
/**
* Constructor
*/
public WebAppMain()
{
}
public void init() {
super.init();
getMarkupSettings().setStripWicketTags(true);
}
/**
* @see wicket.Application#getHomePage()
*/
public Class getHomePage()
{
return Index.class;
}
/**
* @see wicket.protocol.http.WebApplication#getSessionFactory()
*/
public ISessionFactory getSessionFactory()
{
return new ISessionFactory()
{
public Session newSession()
{
return new WebAppSession(WebAppMain.this);
}
};
}
/**
* @param service the service to set
*/
public void setService(PersistanceService service) {
this.service = service;
}
/**
* @return the service
*/
public PersistanceService getService() {
return service;
}
}