Maybe it should, but it doesn't. The value of test is always blank, and a
println I put in the getter does not show up in the log. I don't thing the
action is being instantiated until after the form is submitted.


On 2/17/07, Laurie Harper <[EMAIL PROTECTED]> wrote:

Mailing Lists wrote:
> How do you initialize values to use in a form?
>
> I tried just initializing the value in the action and referencing it in
the
> form, but the value is not set.
>
> In action:
>
> private String test = "tesing";
>
> in form:
>
> <s:textfield value="%{test}"/>

That should work fine, provided you have a getter for the 'test'
property in your action.

In general, there is no equivalent of the Struts1 form bean reset()
method in Struts2, since there's no need: the action and the form bean
are the same thing, and get instantiated once per request.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to