01: /*
02: * Copyright 2005 Joe Walker
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.
15: */
16: package org.directwebremoting.jaxer.impl;
17:
18: import org.directwebremoting.extend.CreatorManager;
19: import org.directwebremoting.extend.Remoter;
20: import org.directwebremoting.impl.ContainerUtil;
21: import org.directwebremoting.impl.DefaultContainer;
22: import org.directwebremoting.jaxer.servlet.JaxerInterfaceHandler;
23:
24: /**
25: * This is a simple enhancement of {@link DefaultContainer} that provides a set
26: * of default resources for running inside Jaxer. Since it provides a complete
27: * set of resources without the need for external customization it also
28: * completes the setup phase (in {@link DefaultContainer} terminology)
29: * @author Joe Walker [joe at getahead dot ltd dot uk]
30: */
31: public class JaxerContainer extends DefaultContainer {
32: /**
33: * Provide the defaults
34: */
35: public JaxerContainer() {
36: // Setup the same set of defaults that DWR uses
37: ContainerUtil.setupDefaults(this );
38:
39: // Overrides for custom implementations
40: addImplementation(CreatorManager.class,
41: WideOpenCreatorManager.class);
42: addImplementation(Remoter.class, JaxerRemoter.class);
43: ContainerUtil.createUrlMapping(this , "/new/",
44: "interfaceHandlerUrl", JaxerInterfaceHandler.class);
45:
46: // Custom settings for existing DWR implementations
47: addParameter("debug", "true");
48: addParameter("activeReverseAjaxEnabled", "true");
49: addParameter("initApplicationScopeCreatorsAtStartup", "true");
50: addParameter("maxWaitAfterWrite", "100");
51: addParameter("preferDataUrlSchema", "false");
52: addParameter("allowGetForSafariButMakeForgeryEasier", "true");
53: addParameter("crossDomainSessionSecurity", "false");
54: addParameter("allowScriptTagRemoting", "true");
55: addParameter("useAbsolutePath", "true");
56: addParameter("defaultToAsync", "false");
57: }
58: }
|