struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: NEVERMIND: Changing Request Parameters
Date Fri, 22 Feb 2002 12:51:07 GMT
Phase Communcations wrote:
> I tried to set the reqest value by calling the FormBean and set it from the
> action. But, it doesn't carry over to the next Action. I can't find a way to
> change the request parameters. Please help.

The trick is to put a switch on your form bean to make it immutable.
This way the controller can't mess with it between actions. 


    private boolean mutable = true;
    public void setMutable(boolean mutable) {
        this.mutable = mutable;
    }
    public boolean isMutable() {
        return this.mutable;
    }

    public String whatever = null;
    public void setWhatever(String whatever) {
        if (isMutable()) this.whatever = whatever;
    }
    public String getWhatever() {
        return this.whatever;
    }

Then be sure that reset uses the setters (and doesn't clear mutable).


-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services

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


Mime
View raw message