-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathWicketApplication.java
executable file
·71 lines (64 loc) · 1.98 KB
/
WicketApplication.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* © 2023 iamfortress.net
*/
/*
* © 2023 iamfortress.net
*/
package org.wicketsample;
import org.apache.wicket.csp.CSPDirective;
import org.apache.wicket.csp.CSPDirectiveSrcValue;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.settings.ExceptionSettings;
/*
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
import org.apache.directory.fortress.web.control.WicketSession;
import org.apache.wicket.Session;
*/
/**
* Wicket Sample WebApplication impl.
*
* @author Shawn McKinney
* @version $Rev$
*/
public class WicketApplication extends WebApplication
{
// TODO STEP: uncomment save fortress session to wicket session:
/*
@Override
public Session newSession(Request request, Response response)
{
return new WicketSession(request);
}
*/
/**
* @see org.apache.wicket.Application#init()
*/
@Override
public void init()
{
super.init();
// TODO STEP: uncomment to enable injection of fortress spring beans:
//getComponentInstantiationListeners().add(new SpringComponentInjector(this));
getMarkupSettings().setStripWicketTags(true);
// Route runtime exceptions to fortress error page:
getApplicationSettings().setInternalErrorPage( ErrorPage.class );
// show internal error page rather than default developer page
getExceptionSettings().setUnexpectedExceptionDisplay(ExceptionSettings.SHOW_INTERNAL_ERROR_PAGE);
getMarkupSettings().setStripWicketTags(true);
getCspSettings().blocking().clear()
.add(CSPDirective.STYLE_SRC, CSPDirectiveSrcValue.SELF)
.add(CSPDirective.STYLE_SRC, CSPDirectiveSrcValue.UNSAFE_INLINE)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.SELF)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.UNSAFE_EVAL)
.add(CSPDirective.SCRIPT_SRC, CSPDirectiveSrcValue.UNSAFE_INLINE);
}
/**
* @see org.apache.wicket.Application#getHomePage()
*/
@Override
public Class<? extends WebPage> getHomePage()
{
return LaunchPage.class;
}
}