You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Simon Kelly <ke...@ipe.fzk.de> on 2003/03/24 15:17:48 UTC

Form not populating from post to struts.

Hi all,

Cannot for the life of me spot the problem here.

Could someone check the following and see if there is an obvoius error that
would mean struts wouldn't populate the form.

Cheers

Simon

Form, stripped from the html:
====================
[snip]
<form name="signalSelectForm"
action="/strutscx/signal.do;jsessionid=8AF18163C316123869B5EFBFAD6BC912"
method="post">
[snip]
<input value="fp1v1" name="tables" type="checkbox">
[snip]
<input value="fp1v1.eg1_hv_01" name="signals" type="checkbox"> -
eg1_hv_01<br>
<input value="fp1v1.eg1_mag_01" name="signals" type="checkbox"> -
eg1_mag_01<br>
<input value="fp1v1.eg1_mag_02" name="signals" type="checkbox"> -
eg1_mag_02<br>
[snip]
<input value="submit" type="submit">


Form and action-mapping from struts-conf.xml:
================================
[snip]
<form-bean name="signalSelectForm"
type="com.katrin.presentation.actionform.SignalSelectForm">
</form-bean>
[snip]
<action path="/signal"
            name="signalSelectForm"
            scope="request"
            validate="false"
            type="com.katrin.presentation.action.SignalSelectAction">
        <forward name="success" path="/StrutsCXServlet" />
</action>

Form:
=====

public class SignalSelectForm extends ActionForm{

    private ArrayList tables = new ArrayList();
    private String startDate;
    private String endDate;
    private String dateSearchType;
    private ArrayList signals = new ArrayList();

    public void setTables(String newtable) {
        this.tables.add(newtable);
    }

    public void setStartDate(String date) {
        this.startDate = new String(date);
    }

    public void setEndDate(String date) {
        this.endDate = new String(date);
    }

    public void setDataSearchType(String type) {
        this.dateSearchType = new String(type);
    }

    public void setSignals(String newsignal) {
        this.signals.add(newsignal);
    }

    public ArrayList getTables() {
        return this.tables;
    }

    public String getStartDate() {
        return this.startDate;
    }

    public String getEndDate() {
        return this.endDate;
    }

    public String getDataSearchType() {
        return this.dateSearchType;
    }
    public ArrayList getSignals() {
        return this.signals;
    }

    public void reset() {
        this.tables.clear();
        this.startDate = new String("");
        this.endDate = new String("");
        this.dateSearchType = new String("");
        this.signals.clear();
    }
}

Institut fuer
Prozessdatenverarbeitung
und Elektronik,
Forschungszentrum Karlsruhe GmbH,
Postfach 3640,
D-76021 Karlsruhe,
Germany.

Tel: (+49)/7247 82-4042
E-mail : kelly@ipe.fzk.de


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org