01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.examples;
18:
19: import org.apache.commons.logging.Log;
20: import org.apache.commons.logging.LogFactory;
21: import org.apache.wicket.protocol.http.WebApplication;
22: import org.apache.wicket.settings.ISecuritySettings;
23: import org.apache.wicket.util.crypt.ClassCryptFactory;
24: import org.apache.wicket.util.crypt.NoCrypt;
25:
26: /**
27: * Wicket Application class for hello world example.
28: *
29: * @author Jonathan Locke
30: */
31: public abstract class WicketExampleApplication extends WebApplication {
32: /**
33: * Used for logging.
34: */
35: private static final Log log = LogFactory
36: .getLog(WicketExampleApplication.class);
37:
38: /**
39: * Constructor.
40: */
41: public WicketExampleApplication() {
42: }
43:
44: /**
45: * @see org.apache.wicket.protocol.http.WebApplication#init()
46: */
47: protected void init() {
48: // WARNING: DO NOT do this on a real world application unless
49: // you really want your app's passwords all passed around and
50: // stored in unencrypted browser cookies (BAD IDEA!)!!!
51:
52: // The NoCrypt class is being used here because not everyone
53: // has the java security classes required by Crypt installed
54: // and we want them to be able to run the examples out of the
55: // box.
56: getSecuritySettings().setCryptFactory(
57: new ClassCryptFactory(NoCrypt.class,
58: ISecuritySettings.DEFAULT_ENCRYPTION_KEY));
59: }
60: }
|