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