Anonymous avatar Anonymous committed 59bd300

Client Dispatcher

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@534 573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (18)

src/etc/example/client-dispatcher.xml

+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<xwork>
+    <package name="clientDispatcher" extends="webwork-default" namespace="/clientDispatcher">
+        <result-types>
+            <result-type name="client" class="com.opensymphony.webwork.dispatcher.client.ServerHttpDispatcherResult"/>
+        </result-types>
+        <interceptors>
+            <interceptor-stack name="clientStack">
+                <interceptor-ref name="defaultStack"/>
+            </interceptor-stack>
+        </interceptors>
+        <default-interceptor-ref name="clientStack"/>
+        <action name="com.opensymphony.webwork.example.client.DemoAction" class="com.opensymphony.webwork.example.client.DemoAction">
+            <result name="success" type="client"/>
+            <result name="input" type="client"/>
+            <result name="error" type="client"/>
+            <interceptor-ref name="defaultStack"/>
+        </action>
+    </package>
+</xwork>

src/etc/example/client/xwork-object-mappings.xml

+<mappings>
+        <mappingSet name="demo-mappings">
+                <parameterMappings>
+                        <mapping pojoExpression="invocationNumber.text" actionExpression="param1"/>
+                </parameterMappings>
+                <resultMappings>
+                        <mapping actionExpression="param1" pojoExpression="input.text"/>
+                        <mapping actionExpression="result1" pojoExpression="output.text"/>
+                </resultMappings>
+        </mappingSet>
+</mappings>

src/etc/example/client/xwork.xml

+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<xwork>
+
+    <include file="webwork-default.xml"/>
+    <package name="clientDispatcher" extends="webwork-default" namespace="/clientDispatcher">
+        <result-types>
+            <result-type name="object" class="com.opensymphony.xwork.dispatcher.ObjectResult"/>
+        </result-types>
+        <interceptors>
+            <interceptor-stack name="clientStack">
+                <interceptor-ref name="defaultStack"/>
+            </interceptor-stack>
+        </interceptors>
+        <default-interceptor-ref name="clientStack"/>
+        <action name="DemoAction" class="com.opensymphony.webwork.example.client.DemoAction">
+            <result name="success" type="object">
+                    <param name="mappingName">demo-mappings</param>
+                    <param name="viewName">success</param>
+            </result>
+            <result name="error" type="object">
+                    <param name="mappingName">demo-mappings</param>
+                    <param name="viewName">error</param>
+            </result>
+            <interceptor-ref name="defaultStack"/>
+        </action>
+    </package>
+
+</xwork>

src/etc/example/xwork-client.xml

+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<xwork>
+
+    <include file="webwork-default.xml"/>
+    <package name="clientDispatcher" extends="webwork-default" namespace="/clientDispatcher">
+        <result-types>
+            <result-type name="object" class="com.opensymphony.xwork.dispatcher.ObjectResult"/>
+        </result-types>
+        <interceptors>
+            <interceptor-stack name="clientStack">
+                <interceptor-ref name="defaultStack"/>
+            </interceptor-stack>
+        </interceptors>
+        <default-interceptor-ref name="clientStack"/>
+        <action name="DemoAction" class="com.opensymphony.webwork.example.client.DemoAction">
+            <result name="success" type="object">
+                    <param name="mappingName">demo-mappings</param>
+                    <param name="viewName">noName</param>
+            </result>
+            <interceptor-ref name="defaultStack"/>
+        </action>
+    </package>
+
+</xwork>

src/etc/example/xwork.xml

 
     <include file="file-upload.xml"/>
 
+    <include file="client-dispatcher.xml"/>
+
 </xwork>
Add a comment to this file

src/etc/security/demoKeystore

Binary file added.

src/example/com/opensymphony/webwork/example/client/demo.properties

+# ===================================================================
+# Properties file for com.opensymphony.webwork.dispatcher.client.Demo
+# ===================================================================
+#
+# Welcome to the WebWork2 Client Dispatcher. Features include:
+#
+#  * Pluggable architecture
+#  * java.util.Properties based configuration
+#  * Support for both HTTP and HTTPS protocols
+#  * Considerable support for HTTPS server certificate acceptance rules
+#  * Progress monitoring architecture, including a SWING monitoring toolbar
+#  * Interceptors to improve ease of use
+#  * Thorough JavaDocs
+#  * Minimal across-the-wire object transfers
+#  * Session support
+#  * Not requiring client side actions to be full WebWork Actions
+#  * Demonstration SWING application
+#
+# Client Dispatcher relies on WebWork2, XWork and the cglib-asm.jar package.
+#
+# To get started, the best way is to try out the Demo application, look through
+# its code, and then set it to work in your own project. There are plenty of
+# JavaDocs should you need them, and support is available on the WebWork list.
+#
+# To use the Demo application, you will need to configure the
+# ServerHttpDispatcher. Refer to its JavaDocs for details of what you need in
+# web.xml. You'll also need to add a <result-type> to xwork.xml for the
+# ServerHttpDispatcherResult. Refer to its JavaDocs for details. Finally, you
+# will need a suitable <action> in your xwork.xml for the DemoAction class.
+# For example:
+#
+#  <action name="com.opensymphony.webwork.dispatcher.client.DemoAction" class="com.opensymphony.webwork.dispatcher.client.DemoAction">
+#   <result name="success" type="client"/>
+#   <result name="input" type="client"/>
+#   <result name="error" type="client"/>
+#   <interceptor-ref name="defaultStack"/>
+#  </action>
+#
+# Once this is done, you'll need to know the URL to use to connect to the
+# ServerHttpDispatcher on your local web server. Once you know this, edit the
+# "url" properties below to match.
+#
+# Altrernatively supply the URL on the command line (useful with Java Web Start)
+#
+# After you start the Demo class, click "Start New Client Request" and allow it
+# to run. Note the progress monitoring in the toolbar. The DemoAction itself is
+# somewhat unimpressive (it just squares a number) but we're more interested in
+# how the action is being transferred. Once the action has finished running,
+# click the security icon in the toolbar. This will expose two tabs of
+# information about the Client Dispatcher session. Also try clicking the "Start
+# New Client Request" four or five times, to observe the monitoring behaviour
+# when there are concurrent requests.
+#
+# NOTE: Demos 2, 3 and 4 require your web server to be setup for HTTPS!
+# It is recommended you do this, to get the most out of the demonstration
+# (specifically, being able to see enhanced session information).
+# Demo 4 must have a keystore on the classpath that matches the HTTPS
+# certificate that your web server is presenting.
+#
+# The Client Dispatcher is provided "as is", without any warranty whatsoever.
+# It has not been thoroughly tested. ***** Use solely at your own risk *****
+# Enhancements are planned in the future to fully support proxy servers and
+# Java Web Start.
+#
+# If you have any questions, try the WebWork2 list. Or email the author,
+# Ben Alex, at ben.alex@acegi.com.au.
+#
+# Acknowledgements are due to Sun, for the SwingWorker class (called
+# DemoSwingWorker in the package) and The Eclipse Project, for the GIF icons
+# used in the monitoring toolbar. And of course to everyone involved in the
+# WebWork project!
+
+# Note: The url property is now supplied on the command line via Java Web Start to allow dynamic
+# url setting. If it is desirable to have a static URL then uncomment one of these values
+# DEMO 1: NORMAL HTTP CONNECTION
+#com.opensymphony.webwork.dispatcher.client.url=http://localhost:8080/admin/ClientDispatcher
+#com.opensymphony.webwork.dispatcher.client.url=@BASE-URL@/ClientDispatcher
+
+
+# DEMO 2: HTTPS + TRUST ANY CONNECTION
+#com.opensymphony.webwork.dispatcher.client.url=https://localhost:8443/admin/ClientDispatcher
+#com.opensymphony.webwork.dispatcher.client.trustManager=com.opensymphony.webwork.dispatcher.client.TransportHttpTrustAny
+
+
+# DEMO 3: HTTPS + TRUST ANY CONNECTION + WITHOUT X509 LOOKUP
+#com.opensymphony.webwork.dispatcher.client.url=https://localhost:8443/admin/ClientDispatcher
+#com.opensymphony.webwork.dispatcher.client.trustManager=com.opensymphony.webwork.dispatcher.client.TransportHttpTrustAny
+#com.opensymphony.webwork.dispatcher.client.lookupSslInformation=false
+
+
+# DEMO 4: HTTPS + TRUST KEYSTORE ONLY
+#com.opensymphony.webwork.dispatcher.client.url=https://localhost:8443/admin/ClientDispatcher
+#com.opensymphony.webwork.dispatcher.client.trustManager=com.opensymphony.webwork.dispatcher.client.TransportHttpTrustKeystore
+#com.opensymphony.webwork.dispatcher.client.keystoreFile=keystore.rootca
+#com.opensymphony.webwork.dispatcher.client.keystorePassword=password
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/security-encrypted.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/security-identified.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/security-none.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-connecting.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-none.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-processing.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-received.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-receiving.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-retry-delay.gif

Added
New image
Add a comment to this file

src/example/com/opensymphony/webwork/example/client/status-sending.gif

Added
New image

src/example/log4j.properties

+log4j.rootLogger=INFO, CONSOLE
+
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
+
+# Print only messages of level WARN or above in the package com.foo.
+# log4j.logger.com.foo=WARN
+
+#log4j.logger.au.gov.sa.health.oacis=DEBUG
+#log4j.logger.com.opensymphony.webwork=DEBUG
+#log4j.logger.org.apache=INFO
+#log4j.logger.net.sf.hibernate=INFO
+#log4j.logger.ca.uhn=INFO
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.