2 * Copyright 2005-2010 the original author or authors.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.wamblee.photos.wicket;
18 import javax.servlet.http.HttpServletRequest;
20 import org.apache.wicket.Request;
21 import org.apache.wicket.RequestCycle;
22 import org.apache.wicket.Response;
23 import org.apache.wicket.protocol.http.WebApplication;
24 import org.apache.wicket.protocol.http.WebRequest;
25 import org.apache.wicket.request.target.basic.RedirectRequestTarget;
26 import org.apache.wicket.settings.IApplicationSettings;
27 import org.wamblee.wicket.inject.ComponentInstantiationInjector;
28 import org.wamblee.wicket.transactions.OpenTransactionInViewRequestCycle;
31 * Application object for your web application. If you want to run this
32 * application without deploying, run the Start class.
34 * @see org.wamblee.Start#main(String[])
36 public class WicketApplication extends WebApplication {
41 public WicketApplication() {
46 public RequestCycle newRequestCycle(Request aRequest, Response aResponse) {
47 return new OpenTransactionInViewRequestCycle(this,
48 (WebRequest) aRequest, aResponse);
52 protected void init() {
54 addComponentInstantiationListener(new ComponentInstantiationInjector());
56 IApplicationSettings settings = getApplicationSettings();
57 settings.setInternalErrorPage(ErrorPage.class);
59 // Use the lines below to get the internal error page also when in
61 // IExceptionSettings exs = getExceptionSettings();
62 // exs.setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
66 * @see org.apache.wicket.Application#getHomePage()
68 public Class<HomePage> getHomePage() {
69 return HomePage.class;