1. opensymphony
  2. webwork

Commits

jcarreira  committed f2e97d0

* Re-adding libs that should not have been removed
* Removing stranded client dispatcher examples
* Fixing JSP errors with taglib compliance

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

  • Participants
  • Parent commits df45b8c
  • Branches master

Comments (0)

Files changed (38)

File build.xml

View file
  • Ignore whitespace
     <property name="build.example" value="${build}/example"/>
     <property name="build.example.jars" value="${build}/example-jars"/>
     <property name="build.example-war" value="${build}/example-war"/>
-    <property name="build.example.client.jar" value="${build}/example-client.jar"/>
     <property name="build.config-browser" value="${build}/config-browser"/>
     <property name="build.config-browser.jar" value="${build}/webwork-config-browser.jar"/>
     <property name="build.migration" value="${build}/migration"/>
         </copy>
 
         <copy file="${src.etc}/taglib.tld" tofile="${build}/webwork.tld"/>
-
-        <jar basedir="${build.example}" jarfile="${build.example.client.jar}">
-                <include name="**/client/**"/>
-                <include name="**/log4j.properties"/>
-        </jar>
-
-        <jar basedir="${src.etc}/example/client" jarfile="${build.example.client.jar}" update="true">
-                <include name="*.xml"/>
-        </jar>
     </target>
 
     <target name="signjar" depends="example-jar">
                 <include name="xwork.jar"/>
             </fileset>
             <fileset file="${build}/${name}-${version}.jar"/>
-            <fileset file="${build.example.client.jar}"/>
             <fileset file="${lib.build}/servlet.jar"/>
             <fileset dir="${lib.optional}">
                 <include name="object-dispatcher.jar"/>
                 <include name="oscore.jar"/>
                 <include name="xwork.jar"/>
                 <include name="${name}-${version}.jar"/>
-                <include name="example-client.jar"/>
                 <include name="servlet.jar"/>
                 <include name="object-dispatcher.jar"/>
                 <include name="log4j-1.2.8.jar"/>
             <lib dir="${lib.example}"/>
             <lib file="${build}/${name}-${version}.jar"/>
             <lib file="${build.config-browser.jar}"/>
-            <lib file="${build.example.client.jar}"/>
             <webinf file="${build}/webwork.tld"/>
             <classes dir="${build.example}"/>
             <classes dir="${src.etc}/example"/>

File lib/optional/bsh.jar

  • Ignore whitespace
Binary file added.

File lib/optional/commons-beanutils.jar

  • Ignore whitespace
Binary file added.

File lib/optional/commons-collections.jar

  • Ignore whitespace
Binary file added.

File lib/optional/commons-digester.jar

  • Ignore whitespace
Binary file added.

File lib/optional/libraries.txt

View file
  • Ignore whitespace
 bsh.jar - BeanShell version 1.2 b6
-cglib-full.jar = CGLib 2.0.2
 commons-beanutils.jar - Apache Commons BeanUtils version 1.5
 commons-collections.jar - Apache Commons Collections version 2.1
 commons-digester.jar - Apache Commons Digester version 1.3

File src/etc/example/client-dispatcher.xml

  • Ignore whitespace
-<!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>

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

  • Ignore whitespace
-<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>

File src/etc/example/client/xwork.xml

  • Ignore whitespace
-<!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>

File src/etc/example/xwork-client.xml

  • Ignore whitespace
-<!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>

File src/etc/example/xwork.xml

View file
  • Ignore whitespace
 
     <include file="file-upload.xml"/>
 
-    <include file="client-dispatcher.xml"/>
-
 </xwork>

File src/example/com/opensymphony/webwork/example/client/Demo.java

  • Ignore whitespace
-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.webwork.example.client;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Properties;
-
-import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-
-import com.opensymphony.webwork.dispatcher.client.ClientException;
-import com.opensymphony.webwork.dispatcher.client.TransportFactory;
-import com.opensymphony.webwork.dispatcher.client.TransportHttp;
-import com.opensymphony.xwork.dispatcher.MappingFactory;
-import com.opensymphony.xwork.dispatcher.ObjectDispatcher;
-import com.opensymphony.xwork.dispatcher.ResultObjectFactory;
-import com.opensymphony.xwork.dispatcher.XMLMappingFactory;
-import com.opensymphony.xwork.util.OgnlValueStack;
-import java.io.StringWriter;
-import java.io.PrintWriter;
-import com.opensymphony.xwork.ObjectFactory;
-import com.opensymphony.webwork.dispatcher.client.HTTPClientObjectFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import com.opensymphony.xwork.ActionProxyFactory;
-import com.opensymphony.webwork.dispatcher.client.HTTPClientActionProxyFactory;
-
-
-/**
- * SWING-based demonstration of Client Dispatcher and notification system.
- * Requires <code>demo.properties</code> to be available on classpath.
- *
- * @version $Id$
- * @author Ben Alex (<a href="mailto:ben.alex@acegi.com.au">ben.alex@acegi.com.au</a>)
- */
-public class Demo extends JFrame {
-    //~ Instance fields ////////////////////////////////////////////////////////
-
-    private DemoResult taskOutput;
-    private TransportFactory transportFactory;
-    private int taskNumber = 1;
-
-    /** logger for this class */
-    private static final Log log = LogFactory.getLog(Demo.class);
-
-
-    //~ Constructors ///////////////////////////////////////////////////////////
-
-    /**
-     * Construct the demo object
-     * @param connectionURL The URL to connect to to process the remote action invocations. If this
-     * is null it will be searched for in the demo.properties file
-     * @throws ClientException
-     * @throws IOException
-     */
-    public Demo(String connectionURL) throws ClientException, IOException {
-        super("WebWork2 Client Dispatcher Demonstration");
-
-        // Load in the properties
-        URL url = this.getClass().getClassLoader().getResource("com/opensymphony/webwork/example/client/demo.properties");
-
-        if (url == null) {
-            throw new IOException("demo.properties not found on classpath");
-        }
-
-        InputStream inputStream = url.openStream();
-        Properties props = new Properties();
-        props.load(inputStream);
-
-        if (connectionURL != null) {
-            props.setProperty(TransportHttp.KEY_URL, connectionURL);
-        }
-
-        // Create the connection factory
-        transportFactory = new TransportHttp(props);
-
-        // Set up the action factory
-        ObjectFactory.setObjectFactory(new HTTPClientObjectFactory(transportFactory));
-        ActionProxyFactory.setFactory(new HTTPClientActionProxyFactory());
-
-        // Create a progress consumer and attach it to the connection factory
-        ProgressConsumerToolBar consumer = new ProgressConsumerToolBar(this);
-        transportFactory.setProgressConsumer(consumer);
-        consumer.setBorderPainted(true);
-        consumer.setFloatable(false);
-
-        //consumer.setToolTipText("Progress Monitor");
-        //Create the demo's UI.
-        JButton startButton = new JButton("Start New Client Request");
-        startButton.setActionCommand("start");
-        startButton.addActionListener(new ButtonListener());
-
-        taskOutput = new DemoResult();
-
-        JPanel panel = new JPanel();
-        panel.add(startButton);
-
-        JPanel contentPane = new JPanel();
-        contentPane.setLayout(new BorderLayout());
-        contentPane.add(panel, BorderLayout.NORTH);
-        contentPane.add(consumer, BorderLayout.SOUTH);
-        contentPane.add(new JScrollPane(taskOutput), BorderLayout.CENTER);
-        contentPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
-        setContentPane(contentPane);
-    }
-
-    //~ Methods ////////////////////////////////////////////////////////////////
-
-    public static void main(String[] args) throws ClientException, IOException {
-        JFrame frame = new Demo(args[0]);
-        frame.addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
-                    System.exit(0);
-                }
-            });
-
-        frame.pack();
-        frame.setVisible(true);
-    }
-
-    //~ Inner Classes //////////////////////////////////////////////////////////
-
-    class ActualTask implements ResultObjectFactory {
-        ActualTask() {
-            int thisTaskNumber = ++taskNumber;
-            taskOutput.getInvocationNumber().setText(taskNumber + "");
-            taskOutput.getMessages().setText("");
-
-            OgnlValueStack result = null;
-            try {
-                MappingFactory mappingFactory = new XMLMappingFactory();
-                ObjectDispatcher objectDispatcher = new ObjectDispatcher(mappingFactory);
-                result = objectDispatcher.dispatch(taskOutput,
-                    "/clientDispatcher",
-                    "DemoAction",
-                    "demo-mappings",
-                    this);
-            } catch (Exception ex) {
-                StringWriter stackTrace = new StringWriter();
-
-                ex.printStackTrace(new PrintWriter(stackTrace, true));
-                taskOutput.getMessages().append("Error during invocation number: " + thisTaskNumber
-                                                + ": " + "\n");
-                taskOutput.getMessages().append(stackTrace + "\n");
-            }
-        }
-
-        /**
-         * Get a result object to copy the information to
-         * @param viewName nominally the name of the result object but we only have 1 in this case
-         * @return the task output panel
-         */
-        public Object getResultObject(String viewName) {
-            // only 1 possible object
-            log.debug("Returning result object: " + taskOutput);
-            if ("error".equals(viewName)) {
-                taskOutput.getMessages().append("The server reported an error whilst executing the action\n");
-            }
-            return taskOutput;
-        }
-    }
-
-    class ButtonListener implements ActionListener {
-        public void actionPerformed(ActionEvent evt) {
-            final DemoSwingWorker worker = new DemoSwingWorker() {
-                public Object construct() {
-                    return new ActualTask();
-                }
-            };
-
-            worker.start();
-        }
-    }
-}

File src/example/com/opensymphony/webwork/example/client/DemoAction.java

  • Ignore whitespace
-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.webwork.example.client;
-
-import java.io.Serializable;
-
-import com.opensymphony.webwork.dispatcher.client.ClientRequest;
-import com.opensymphony.webwork.dispatcher.client.ClientRequestInvocation;
-import com.opensymphony.xwork.Action;
-
-
-/**
- * WebWork Action used by the {@link Demo Demo} class.
- *
- * @version $Id$
- * @author Ben Alex (<a href="mailto:ben.alex@acegi.com.au">ben.alex@acegi.com.au</a>)
- */
-public class DemoAction implements Action, ClientRequest {
-    //~ Static fields/initializers /////////////////////////////////////////////
-
-    /**
-     * Variable solely to increase object size.
-     */
-    static Acl acl = new Acl();
-
-    /**
-     * Variable solely to increase object size.
-     */
-    static Bcl bcl = new Bcl(acl);
-
-    //~ Instance fields ////////////////////////////////////////////////////////
-
-    Bcl param2;
-    int param1;
-    int result1;
-
-    /**
-     * Variable solely to increase object size.
-     */
-    private Bcl junkHolder = null;
-
-    /**
-     * Required for {@link ClientRequest ClientRequest} interface.
-     */
-    private ClientRequestInvocation clientRequestInvocation;
-
-    //~ Methods ////////////////////////////////////////////////////////////////
-
-    public void setClientRequestInvocation(ClientRequestInvocation clientRequestInvocation) {
-        this.clientRequestInvocation = clientRequestInvocation;
-    }
-
-    public ClientRequestInvocation getClientRequestInvocation() {
-        return clientRequestInvocation;
-    }
-
-    /**
-     * Set the number we would like squared.
-     */
-    public void setParam1(int param1) {
-        this.param1 = param1;
-    }
-
-    /**
-     * Getter for property param1.
-     * @return the number we would like squared
-     */
-    public int getParam1() {
-        return param1;
-    }
-
-    /**
-     * Set an object array to increase the size of the request or reply.
-     */
-    public void setParam2(Bcl param2) {
-        this.param2 = param2;
-    }
-
-    /**
-     * Get the result of squaring <code>param1</code>. You must call
-     * {@link DemoAction#execute() DemoAction.execute()} first, after first
-     * building a {@link ClientRequest ClientRequest} proxy using the
-     * {@link TransportFactory#createClientRequestProxy(ClientRequest)
-     * TransportFactory.createClientRequestProxy(ClientRequest)} method.
-     */
-    public int getResult1() {
-        return result1;
-    }
-
-    /**
-     * Execute method. We return an <code>ERROR</code> if number 7 is the
-     * <code>param1</code>, to demonstrate the operation of
-     * {@link ClientRequestInvocation#getResultCode()
-     * ClientRequestInvocation.getResultCode()}. We return <code>SUCCESS</code>
-     * if any number other than 7 was provided.
-     */
-    public String execute() throws Exception {
-        junkHolder = new Bcl(acl); // make return object bigger
-
-        if (param1 == 7) {
-            result1 = 7;
-
-            return ERROR;
-        } else {
-            result1 = param1 * param1;
-
-            return SUCCESS;
-        }
-    }
-
-    //~ Inner Classes //////////////////////////////////////////////////////////
-
-    /**
-     * Class that is used solely to increase the object's serialized size.
-     */
-    private static class Acl {
-        static String[][][] aclvar = new String[4][366][999];
-    }
-
-    /**
-     * Class that is used solely to increase the object's serialized size.
-     */
-    private static class Bcl implements Serializable {
-        String[][][] bclv = new String[4][366][999];
-
-        Bcl(Acl acl) {
-            for (int a = 0; a < 999; a++) {
-                for (int l = 0; l < 366; l++) {
-                    for (int w = 0; w < 4; w++) {
-                        bclv[w][l][a] = Acl.aclvar[w][l][a];
-                    }
-                }
-            }
-        }
-    }
-}

File src/example/com/opensymphony/webwork/example/client/DemoSwingWorker.java

  • Ignore whitespace
-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-/*
- * This class is freely available on the java.sun.com web site. In accordance
- * with a statement on that web site, "Unless otherwise licensed, code in all
- * technical manuals herein (including articles, FAQs, samples) is provided
- * under this License" with "this License" being found at URL
- * http://developer.java.sun.com/berkeley_license.html. A copy of the
- * license at that URL is contained below:
- *
- * ----------------------------------------------------------------------------
- *
- * Copyright� 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistribution of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistribution in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
- * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
- * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND
- * ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
- * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
- * IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
- * OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
- * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
- * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed, licensed or intended
- * for use in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * ----------------------------------------------------------------------------
- *
- * The above was taken from the java.sun.com web site on 24 July 2003.
- *
- * In addition, the forum posting at
- * http://forum.java.sun.com/thread.jsp?forum=57&thread=283051 appears to
- * confirm the interpretation that the above license applies to this class.
- */
-package com.opensymphony.webwork.example.client;
-
-import javax.swing.SwingUtilities;
-
-
-/**
- * This is the 3rd version of SwingWorker (also known as
- * SwingWorker 3), an abstract class that you subclass to
- * perform GUI-related work in a dedicated thread.  For
- * instructions on and examples of using this class, see:
- *
- * http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html
- *
- * Note that the API changed slightly in the 3rd version:
- * You must now invoke start() on the SwingWorker after
- * creating it.
- */
-public abstract class DemoSwingWorker {
-    //~ Instance fields ////////////////////////////////////////////////////////
-
-    private Object value; // see getValue(), setValue()
-    private ThreadVar threadVar;
-
-    //~ Constructors ///////////////////////////////////////////////////////////
-
-    /**
-     * Start a thread that will call the <code>construct</code> method
-     * and then exit.
-     */
-    public DemoSwingWorker() {
-        final Runnable doFinished = new Runnable() {
-            public void run() {
-                finished();
-            }
-        };
-
-        Runnable doConstruct = new Runnable() {
-            public void run() {
-                try {
-                    setValue(construct());
-                } finally {
-                    threadVar.clear();
-                }
-
-                SwingUtilities.invokeLater(doFinished);
-            }
-        };
-
-        Thread t = new Thread(doConstruct);
-        threadVar = new ThreadVar(t);
-    }
-
-    //~ Methods ////////////////////////////////////////////////////////////////
-
-    /**
-     * Compute the value to be returned by the <code>get</code> method.
-     */
-    public abstract Object construct();
-
-    /**
-     * Called on the event dispatching thread (not on the worker thread)
-     * after the <code>construct</code> method has returned.
-     */
-    public void finished() {
-    }
-
-    /**
-     * Return the value created by the <code>construct</code> method.
-     * Returns null if either the constructing thread or the current
-     * thread was interrupted before a value was produced.
-     *
-     * @return the value created by the <code>construct</code> method
-     */
-    public Object get() {
-        while (true) {
-            Thread t = threadVar.get();
-
-            if (t == null) {
-                return getValue();
-            }
-
-            try {
-                t.join();
-            } catch (InterruptedException e) {
-                Thread.currentThread().interrupt(); // propagate
-
-                return null;
-            }
-        }
-    }
-
-    /**
-     * A new method that interrupts the worker thread.  Call this method
-     * to force the worker to stop what it's doing.
-     */
-    public void interrupt() {
-        Thread t = threadVar.get();
-
-        if (t != null) {
-            t.interrupt();
-        }
-
-        threadVar.clear();
-    }
-
-    /**
-     * Start the worker thread.
-     */
-    public void start() {
-        Thread t = threadVar.get();
-
-        if (t != null) {
-            t.start();
-        }
-    }
-
-    /**
-     * Get the value produced by the worker thread, or null if it
-     * hasn't been constructed yet.
-     */
-    protected synchronized Object getValue() {
-        return value;
-    }
-
-    /**
-     * Set the value produced by worker thread
-     */
-    private synchronized void setValue(Object x) {
-        value = x;
-    }
-
-    //~ Inner Classes //////////////////////////////////////////////////////////
-
-    /**
-     * Class to maintain reference to current worker thread
-     * under separate synchronization control.
-     */
-    private static class ThreadVar {
-        private Thread thread;
-
-        ThreadVar(Thread t) {
-            thread = t;
-        }
-
-        synchronized void clear() {
-            thread = null;
-        }
-
-        synchronized Thread get() {
-            return thread;
-        }
-    }
-}

File src/example/com/opensymphony/webwork/example/client/ProgressConsumerToolBar.java

  • Ignore whitespace
-/*
- * Copyright (c) 2002-2003 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.webwork.example.client;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import java.net.URL;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
-import javax.swing.JScrollPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JTable;
-import javax.swing.JToolBar;
-import javax.swing.table.AbstractTableModel;
-import com.opensymphony.webwork.dispatcher.client.*;
-
-
-/**
- * Provides a <code>JToolBar</code> that is also capable of acting as a
- * {@link ProgressConsumer ProgressConsumer}. This class uses a series of
- * <code>GIF</code> files to display various status and security levels. These
- * <code>GIF</code> files must be located on the classpath.<BR><BR>
- *
- * We thank the Eclipse project for providing the <code>GIF</code> files
- * shipped with the <code>ProgressConsumerToolBar</code>. The Eclipse project
- * license can be found at <a href="http://www.eclipse.org/legal/cpl-v10.html">
- * http://www.eclipse.org/legal/cpl-v10.html</a>.
- *
- * @version $Id$
- * @author Ben Alex (<a href="mailto:ben.alex@acegi.com.au">ben.alex@acegi.com.au</a>)
- */
-public class ProgressConsumerToolBar extends JToolBar implements ProgressConsumer {
-    //~ Static fields/initializers /////////////////////////////////////////////
-
-    private static String NONE = new String("NONE");
-    private static String ZERO = new String("0");
-
-    //~ Instance fields ////////////////////////////////////////////////////////
-
-    private Component parent;
-    private ImageIcon securityEncrypted = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/security-encrypted.gif"), "Encrypted Connection (no identity assurance)");
-    private ImageIcon securityIdentified = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/security-identified.gif"), "Encrypted and Identity Assured Connection");
-    private ImageIcon securityNone = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/security-none.gif"), "Insecure Connection");
-    private ImageIcon statusConnecting = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-connecting.gif"), "Connecting to Remote");
-    private ImageIcon statusNone = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-none.gif"), "");
-    private ImageIcon statusProcessing = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-processing.gif"), "Remote is Processing");
-    private ImageIcon statusReceived = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-received.gif"), "Received");
-    private ImageIcon statusReceiving = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-receiving.gif"), "Receiving from Remote");
-    private ImageIcon statusRetryDelay = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-retry-delay.gif"), "Retrying");
-    private ImageIcon statusSending = new ImageIcon(getUrl("com/opensymphony/webwork/example/client/status-sending.gif"), "Sending to Remote");
-    private JButton securityButton;
-    private JButton statusButton;
-    private JLabel outstandingLabel = new JLabel();
-    private JProgressBar progressBar = new JProgressBar();
-    private Map notifications = new HashMap();
-    private Properties lastFactoryInformation;
-    private Properties lastSecurityInformation;
-    private String currentProgressId;
-
-    //~ Constructors ///////////////////////////////////////////////////////////
-
-    /**
-     * Create a ProgressConsumerToolbar. The parent Component is required so
-     * a dialog can be created if a user clicks on the status or security icon.
-     */
-    public ProgressConsumerToolBar(Component parent) {
-        Properties props = new Properties();
-        props.setProperty("Status", "Unavailable (no connection attempted)");
-        lastFactoryInformation = props;
-        lastSecurityInformation = props;
-        this.parent = parent;
-        outstandingLabel.setFont(new Font("Monospaced", Font.PLAIN, 12));
-        outstandingLabel.setText(ZERO);
-        outstandingLabel.setToolTipText("Number of Pending Remote Actions");
-        statusButton = new JButton(statusNone);
-        statusButton.setBorderPainted(false);
-        statusButton.setFocusPainted(false);
-        statusButton.setMargin(new Insets(0, 0, 0, 0));
-        statusButton.addActionListener(new ButtonListener());
-        securityButton = new JButton(statusNone);
-        securityButton.setBorderPainted(false);
-        securityButton.setFocusPainted(false);
-        securityButton.setMargin(new Insets(0, 0, 0, 0));
-        securityButton.addActionListener(new ButtonListener());
-        add(outstandingLabel);
-        add(statusButton);
-        add(securityButton);
-        add(progressBar);
-        currentProgressId = NONE;
-    }
-
-    //~ Methods ////////////////////////////////////////////////////////////////
-
-    /**
-     * Method called by the connection factory to advise of a progress update.
-     */
-    public synchronized void notify(ProgressNotification progressNotification) {
-        if (progressNotification.getStatus() == ProgressNotification.STATUS_NONE) {
-            notifications.remove(progressNotification.getId());
-        } else {
-            notifications.put(progressNotification.getId(), progressNotification);
-
-            if (currentProgressId.equals(NONE)) {
-                currentProgressId = progressNotification.getId();
-            }
-        }
-
-        if (progressNotification.getId().equals(currentProgressId)) {
-            if (progressNotification.getStatus() == ProgressNotification.STATUS_NONE) {
-                if (notifications.size() > 0) {
-                    Iterator iterator = notifications.keySet().iterator();
-                    currentProgressId = (String) iterator.next();
-                    progressNotification = (ProgressNotification) notifications.get(currentProgressId);
-                } else {
-                    currentProgressId = NONE;
-                }
-            }
-        }
-
-        if (currentProgressId.equals(NONE)) {
-            outstandingLabel.setText(ZERO);
-            statusButton.setIcon(statusNone);
-            statusButton.setToolTipText("");
-            progressBar.setIndeterminate(false);
-            progressBar.setValue(0);
-            progressBar.setToolTipText("");
-        } else {
-            int remaining = notifications.size();
-            outstandingLabel.setText(new Integer(remaining).toString());
-            lastFactoryInformation = progressNotification.getFactoryInformation();
-            lastSecurityInformation = progressNotification.getSecurityInformation();
-
-            if (progressNotification.getSecurity() == ProgressNotification.SECURITY_NONE) {
-                securityButton.setIcon(securityNone);
-                securityButton.setToolTipText(securityNone.getDescription());
-            } else if (progressNotification.getSecurity() == ProgressNotification.SECURITY_ENCRYPTED) {
-                securityButton.setIcon(securityEncrypted);
-                securityButton.setToolTipText(securityEncrypted.getDescription());
-            } else if (progressNotification.getSecurity() == ProgressNotification.SECURITY_IDENTIFIED) {
-                securityButton.setIcon(securityIdentified);
-                securityButton.setToolTipText(securityIdentified.getDescription());
-            }
-
-            if (progressNotification.getStatus() == ProgressNotification.STATUS_NONE) {
-                statusButton.setIcon(statusNone);
-                statusButton.setToolTipText("");
-                progressBar.setIndeterminate(false);
-                progressBar.setValue(0);
-                progressBar.setToolTipText("");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_CONNECTING) {
-                statusButton.setIcon(statusConnecting);
-                statusButton.setToolTipText(statusConnecting.getDescription());
-                progressBar.setIndeterminate(true);
-                progressBar.setToolTipText("Trying...");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_PROCESSING) {
-                statusButton.setIcon(statusProcessing);
-                statusButton.setToolTipText(statusProcessing.getDescription());
-                progressBar.setIndeterminate(true);
-                progressBar.setToolTipText("Waiting...");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_RECEIVING) {
-                statusButton.setIcon(statusReceiving);
-                statusButton.setToolTipText(statusReceiving.getDescription());
-                progressBar.setIndeterminate(false);
-
-                float completed = (float) progressNotification.getInputReceived();
-                float ofTotal = (float) progressNotification.getInputSize();
-                progressBar.setValue((int) (completed / ofTotal * 100));
-                progressBar.setToolTipText("Receive Progress...");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_RECEIVED) {
-                statusButton.setIcon(statusReceived);
-                statusButton.setToolTipText(statusReceived.getDescription());
-                progressBar.setIndeterminate(false);
-                progressBar.setValue(0);
-                progressBar.setToolTipText("");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_RETRY_DELAY) {
-                statusButton.setIcon(statusRetryDelay);
-                statusButton.setToolTipText(statusRetryDelay.getDescription());
-                progressBar.setIndeterminate(true);
-                progressBar.setToolTipText("Retrying...");
-            } else if (progressNotification.getStatus() == ProgressNotification.STATUS_SENDING) {
-                statusButton.setIcon(statusSending);
-                statusButton.setToolTipText(statusSending.getDescription());
-                progressBar.setIndeterminate(false);
-
-                float completed = (float) progressNotification.getOutputTransmitted();
-                float ofTotal = (float) progressNotification.getOutputSize();
-                progressBar.setValue((int) (completed / ofTotal * 100));
-                progressBar.setToolTipText("Send Progress...");
-            }
-        }
-    }
-
-    private URL getUrl(String filename) {
-        URL url = this.getClass().getClassLoader().getResource(filename);
-
-        return url;
-    }
-
-    /**
-     * Create a <code>JPanel</code> containing the given
-     * <code>Properties</code>.
-     */
-    private Component makeTab(Properties info) {
-        JPanel panel = new JPanel();
-
-        PropertiesTableModel propsModel = new PropertiesTableModel();
-        propsModel.setupData(info);
-
-        JTable table = new JTable(propsModel);
-        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
-        table.setRowSelectionAllowed(true);
-        table.setColumnSelectionAllowed(false);
-        table.setCellSelectionEnabled(false);
-        table.setPreferredScrollableViewportSize(new Dimension(500, 400));
-        table.getColumnModel().getColumn(0).setPreferredWidth(150);
-        table.getColumnModel().getColumn(1).setPreferredWidth(1000);
-
-        JScrollPane scrollPane = new JScrollPane(table);
-        panel.add(scrollPane);
-
-        return panel;
-    }
-
-    //~ Inner Classes //////////////////////////////////////////////////////////
-
-    /**
-     * Responds to clicks on the security and status icons, creating a
-     * new dialog that displays connection related information.
-     */
-    private class ButtonListener implements ActionListener {
-        public void actionPerformed(ActionEvent evt) {
-            final DemoSwingWorker worker = new DemoSwingWorker() {
-                public Object construct() {
-                    JTabbedPane tabbedPane = new JTabbedPane();
-
-                    Component factoryInformation = makeTab(lastFactoryInformation);
-                    tabbedPane.addTab("Connection", factoryInformation);
-
-                    Component securityInformation = makeTab(lastSecurityInformation);
-                    tabbedPane.addTab("Security", securityInformation);
-
-                    JOptionPane.showMessageDialog(parent, tabbedPane, "Connection Information", JOptionPane.INFORMATION_MESSAGE);
-
-                    return "done";
-                }
-            };
-
-            worker.start();
-        }
-    }
-
-    /**
-     * Produces a <code>JTable</code> containing information from a
-     * <code>Properties</code> object.
-     */
-    private class PropertiesTableModel extends AbstractTableModel {
-        private Object[][] data;
-        private String[] headers = {"Property", "Value"};
-
-        public int getColumnCount() {
-            return headers.length;
-        }
-
-        public String getColumnName(int col) {
-            return headers[col];
-        }
-
-        public int getRowCount() {
-            return data.length;
-        }
-
-        public Object getValueAt(int row, int col) {
-            return (row < data.length) ? data[row][col] : null;
-        }
-
-        public void setupData(Properties properties) {
-            // Sort properties by key
-            List list = new ArrayList(20);
-            Iterator iterator = properties.keySet().iterator();
-
-            while (iterator.hasNext()) {
-                list.add(iterator.next());
-            }
-
-            Collections.sort(list);
-
-            // Add sorted properties to table data model
-            data = new Object[properties.size()][2];
-
-            int row = 0;
-            iterator = list.iterator();
-
-            while (iterator.hasNext()) {
-                String key = (String) iterator.next();
-                data[row][0] = key;
-                data[row][1] = properties.get(key);
-                row++;
-            }
-
-            updateData();
-        }
-
-        public void updateData() {
-            fireTableDataChanged();
-        }
-    }
-}

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

  • Ignore whitespace
-# ===================================================================
-# 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

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

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

  • Ignore whitespace
Removed
Old image

File src/webapp/WEB-INF/web.xml

View file
  • Ignore whitespace
         <load-on-startup>1</load-on-startup>
     </servlet>
 
-    <servlet>
-        <servlet-name>JnlpDownloadServlet</servlet-name>
-        <servlet-class>com.sun.javaws.servlet.JnlpDownloadServlet</servlet-class>
-        <init-param>
-            <param-name>
-                logLevel
-            </param-name>
-            <param-value>
-                DEBUG
-            </param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet>
-       <servlet-name>client</servlet-name>
-       <servlet-class>com.opensymphony.webwork.dispatcher.client.ServerHttpDispatcher</servlet-class>
-    </servlet>
-
     <servlet-mapping>
         <servlet-name>freemarker</servlet-name>
         <url-pattern>*.ftl</url-pattern>
         <url-pattern>*.vm</url-pattern>
     </servlet-mapping>
 
-     <servlet-mapping>
-        <servlet-name>JnlpDownloadServlet</servlet-name>
-        <url-pattern>*.jnlp</url-pattern>
-     </servlet-mapping>
-
-   <servlet-mapping>
-       <servlet-name>client</servlet-name>
-       <url-pattern>/ClientDispatcher</url-pattern>
-   </servlet-mapping>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>default.jsp</welcome-file>

File src/webapp/default.jsp

View file
  • Ignore whitespace
     <li><a href="i18n/velocity/index.html">Velocity example of i18n</a></li>
 </ul>
 
-
-<p class="title">
-Client Server Demo
-</p>
-
-<ul>
-    <li><a href="examples/client/client.jnlp">Launch the Demonstration Client</a></li>
-</ul>
-
-
 <p class="title">
 Misc Demos
 </p>

File src/webapp/examples/bank/transfer.jsp

View file
  • Ignore whitespace
 <body>
    <table>
    <H2> Money Transfer </H2>
-   <form action="<webwork:url page="bank.transfer.action"/>" method="post">
+   <form action="<webwork:url value="bank.transfer.action"/>" method="post">
 
    <ui:textfield label="'Receiver'" name="'receiver'" maxlength="30"/>
 

File src/webapp/examples/client/client.jnlp

  • Ignore whitespace
-<?xml version="1.0" encoding="utf-8"?>
-<!-- JNLP File for Webwork client dispatching Demo Application -->
-<jnlp
-  spec="1.0+"
-  codebase="$$codebase"
-  href="client.jnlp">
-  <information>
-    <title>Webwork Client Dispatcher Demonstration Application</title>
-    <vendor>The OpenSymphony Project</vendor>
-    <homepage href="http://opensymphony.com/"/>
-    <description>Webwork Client Dispatcher Demonstration Application</description>
-    <description kind="short">A demonstration of using Webwork and XWork in a client server
-configuration with a GUI front end. Client dispatcher is used to execute Webwork actions remotely on
-the server and Xwork object dispatcher is used on the client to present results via a GUI</description>
-    <icon kind="splash" href="logo.png"/>
-  </information>
-  <security>
-    <all-permissions/>
-  </security>
-  <resources>
-    <j2se version="1.4+"/>
-    <jar href="/webwork-example/example-client.jar"/>
-    <jar href="/webwork-example/cglib-full-2.0.2.jar"/>
-    <jar href="/webwork-example/commons-logging.jar"/>
-    <jar href="/webwork-example/commons-digester.jar"/>
-    <jar href="/webwork-example/commons-collections.jar"/>
-    <jar href="/webwork-example/commons-beanutils.jar"/>
-    <jar href="/webwork-example/ognl.jar"/>
-    <jar href="/webwork-example/oscore.jar"/>
-    <jar href="/webwork-example/xwork.jar"/>
-    <jar href="/webwork-example/servlet.jar"/>
-    <jar href="/webwork-example/webwork-2.1.1.jar"/>
-    <jar href="/webwork-example/log4j-1.2.8.jar"/>
-    <jar href="/webwork-example/object-dispatcher.jar"/>
-    <property name="log4j.debug" value=""/>
-  </resources>
-  <application-desc main-class="com.opensymphony.webwork.example.client.Demo">
-    <argument>$$context/ClientDispatcher</argument>
-  </application-desc>
-</jnlp>

File src/webapp/examples/client/logo.png

  • Ignore whitespace
Removed
Old image

File src/webapp/examples/helloworld/verbose/login.jsp

View file
  • Ignore whitespace
 <webwork:property/><BR>
 </webwork:iterator>
 
-<FORM ACTION="<webwork:url page="helloworld.login.action"/>" METHOD="POST">
+<FORM ACTION="<webwork:url value="helloworld.login.action"/>" METHOD="POST">
 <TABLE BORDER="1" BGCOLOR=lightyellow>
 <TR><TH COLSPAN=2><webwork:text name="'login'"/></TH></TR>
 

File src/webapp/examples/hiturl.jsp

View file
  • Ignore whitespace
 you will see that the it takes a while for the JVM to "warm up", so make a few runs until the timings become stable.
 
 <center>
-<form action="<webwork:url page="hiturl.action"/>" method="GET">
+<form action="<webwork:url value="hiturl.action"/>" method="GET">
 
 <table width="350" border="0" cellpadding="3" cellspacing="0">
 

File src/webapp/examples/i18n/cart.jsp

View file
  • Ignore whitespace
 <%@ taglib uri="webwork" prefix="webwork" %>
 
-<webwork:property value="cart/items">
+<webwork:push value="cart/items">
 <webwork:if test=".">
 
 	 <center>
   </center>
 
 </webwork:if>
-</webwork:property>
+</webwork:push>

File src/webapp/examples/i18n/checkout.jsp

View file
  • Ignore whitespace
 <webwork:iterator value="cart/items">
 
 		<tr>
-         <webwork:property value="cd" id="cd">
+         <webwork:push value="cd">
 			   <td><b><webwork:property value="album"/></b></td>
 			   <td><b><webwork:property value="artist"/></b></td>
 			   <td><b><webwork:property value="country"/></b></td>
 			   <td><b><webwork:text name="'price'"
                value0="@pricer/computePrice(price)"/></b></td>
-			</webwork:property>
+			</webwork:push>
 
 			<td><b><webwork:property value="quantity"/></b></td>
 		</tr>

File src/webapp/examples/numguess.jsp

View file
  • Ignore whitespace
   Congratulations!  You got it.
   And after just <webwork:property value="guessBean/numGuesses"/> tries.<p>
   Not sure what to do here?
-  Care to <a href="<webwork:url page="numguess.action?begin=true"/>">try again</a>?
+  Care to <a href="<webwork:url value="numguess.action?begin=true"/>">try again</a>?
 </webwork:if>
 <webwork:elseIf test="guessBean/numGuesses == 0">
   Welcome to the Number Guess game.<p>
   I'm thinking of a number between 1 and 100.<p>
 
-  <form action="<webwork:url page="numguess.action"/>" method="POST">
+  <form action="<webwork:url value="numguess.action"/>" method="POST">
    <ui:textfield label="'What\'s your guess?'" name="'guess'"/>
    <input type=submit value="Submit">
   </form>
   You have made <webwork:property value="guessBean/numGuesses"/> guesses.<p>
   I'm thinking of a number between 1 and 100.<p>
 
-  <form action="<webwork:url page="numguess.action"/>" method="POST">
+  <form action="<webwork:url value="numguess.action"/>" method="POST">
    <ui:textfield label="'What\'s your guess?'" name="'guess'"/>
    <input type=submit value="Submit">
   </form>

File src/webapp/examples/numguess/numguess.jsp

View file
  • Ignore whitespace
   Congratulations!  You got it.
   And after just <webwork:property value="guessBean/numGuesses"/> tries.<p>
   Not sure what to do here?
-  Care to <a href="<webwork:url page="numguess.action?begin=true"/>">try again</a>?
+  Care to <a href="<webwork:url value="numguess.action?begin=true"/>">try again</a>?
 </webwork:if>
 <webwork:elseIf test="guessBean/numGuesses == 0">
   Welcome to the Number Guess game.<p>
   I'm thinking of a number between 1 and 100.<p>
 
-  <form action="<webwork:url page="numguess.action"/>" method="POST">
+  <form action="<webwork:url value="numguess.action"/>" method="POST">
    <ui:textfield label="'What\'s your guess?'" name="'guess'"/>
    <input type=submit value="Submit">
   </form>
   You have made <webwork:property value="guessBean/numGuesses"/> guesses.<p>
   I'm thinking of a number between 1 and 100.<p>
 
-  <form action="<webwork:url page="numguess.action"/>" method="POST">
+  <form action="<webwork:url value="numguess.action"/>" method="POST">
    <ui:textfield label="'What\'s your guess?'" name="'guess'"/>
    <input type=submit value="Submit">
   </form>

File src/webapp/examples/userreg/userregistration.jsp

View file
  • Ignore whitespace
        </webwork:iterator>
     </webwork:if>
 
-    <form action="<webwork:url page="userreg.userregistration.action"/>" method="POST">
+    <form action="<webwork:url value="userreg.userregistration.action"/>" method="POST">
         <table width="100%">
         <tr>
            <!-- start cell with webwork components -->