Hi, I noticed one thing, I didn't look at it too in depth yet.
You should override doExecute() not execute()

Regards,
-Andre Mermegas


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Paul Snively
Sent: Thursday, February 13, 2003 1:40 PM
To: '[EMAIL PROTECTED]'
Subject: [OS-webwork] WebWork 1.30RC2 Not Populating Action Properties

Folks,

I'm attempting to build an app using WebWork 1.30RC2, the latest release
as
of this writing. My form page looks as follows:

--------------------------------snip
snip--------------------------------
<%@ taglib uri="webwork" prefix="ww" %>
<%@ taglib uri="webwork" prefix="ui" %>
<%@ taglib uri="webwork" prefix="it" %>

<html><head><title>CVS Chicanery</title></head><body>
<ww:if test="hasErrorMessages == true">
        ERROR:<BR>
        <it:iterator value="errorMessages">
                <FONT COLOR=red><ww:property/></FONT><BR>
        </it:iterator>
</ww:if>

<form action="<ww:url page="cvs.action"/>" method="POST">
        <ui:textarea label="'Paths'" name="'params'" rows="10"/>
        <input type="submit"/>
</form>
</body></html>
--------------------------------snip
snip--------------------------------

And my action as follows:

--------------------------------snip
snip--------------------------------
package com.ifilm.admin.action;

import java.util.StringTokenizer;

import webwork.action.Action;
import webwork.action.ActionSupport;

import com.ice.cvsc.CVSClient;
import com.ice.cvsc.CVSProject;
import com.ice.cvsc.CVSRequest;
import com.ice.cvsc.CVSResponse;
import com.ice.cvsc.CVSRespItemVector;

/**
 * @author psnively
 *
 * To change this generated comment edit the template variable
"typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class CVSAction extends ActionSupport
{
        private String                          host;
        private String                          rootDirectory;
        private String                          rootRepository;
        private String                          localDirectory;
        private String                          userName;
        private String                          password;
        private String                          arguments;
        private String                          params;
        private CVSRespItemVector       items;

        public void setHost(String host)
        {
                this.host = host;
        }

        public String getHost()
        {
                return host;
        }

        public void setRootRepository(String rootRepository)
        {
                this.rootRepository = rootRepository;
        }

        public String getRootRepository()
        {
                return rootRepository;
        }

        public void setRootDirectory(String rootDirectory)
        {
                this.rootDirectory = rootDirectory;
        }

        public String getRootDirectory()
        {
                return rootDirectory;
        }

        public void setLocalDirectory(String localDirectory)
        {
                this.localDirectory = localDirectory;
        }

        public String getLocalDirectory()
        {
                return localDirectory;
        }

        public void setUserName(String userName)
        {
                this.userName = userName;
        }

        public String getUserName()
        {
                return userName;
        }

        public void setPassword(String password)
        {
                this.password = password;
        }

        public String getPassword()
        {
                return password;
        }

        public void setArguments(String arguments)
        {
                this.arguments = arguments;
        }

        public String getArguments()
        {
                return arguments;
        }

        public void setParams(String params)
        {
                this.params = params;
        }

        public String getParams()
        {
                return params;
        }

        public void setItems(CVSRespItemVector items)
        {
                this.items = items;
        }

        public CVSRespItemVector getItems()
        {
                return items;
        }

        public String execute()
        {
                String          result = Action.ERROR;
                CVSRequest      request = new CVSRequest();

                request.setHostName(getHost());
                request.setPort(CVSClient.DEFAULT_SSH_PORT);
                request.setConnectionMethod(CVSRequest.METHOD_SSH);
                request.setRootDirectory(getRootDirectory());
                request.setRootRepository(getRootRepository());
                request.setLocalDirectory(getLocalDirectory());
                request.setUserName(getUserName());
                request.setPassword(getPassword());
                System.err.println(getParams());
                StringTokenizer toke = new StringTokenizer(getParams(),
"\n\r");
                StringBuffer    temp = new StringBuffer();
                while (toke.hasMoreTokens())
                {
                        temp.append(" " + toke.nextToken());
                }
                request.parseArgumentString(getArguments() + temp);

                CVSClient       client = new CVSClient();
                CVSProject      project = new CVSProject(client);
                CVSResponse     response =
client.processCVSRequest(request);
                if (project.processCVSResponse(request, response))
                {
                        setItems(response.getItemList());
                        result = Action.SUCCESS;
                }
                else
                {
                        addErrorMessage(response.getErrorText());
                }

                return result;
        }
}--------------------------------snip
snip--------------------------------

Of course I have configured my views.properties accordingly.

When I visit my page and submit the form, however, the println() of
getParams() to Stderr reveals that it is null: for some reason, it's not
set
by the time execute() is called. Any advice here would be most welcome.

Many thanks and best regards,
Paul Snively
iFilm Corp.



-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork




-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to