struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiuma <>
Subject Re: [STRUTS] Cleasing form fields fields (NOT WORKING)
Date Thu, 19 Sep 2002 15:47:08 GMT
Hello I need scope="session", so I had coded this method into the form

public void reset(ActionMapping mapping,
                  javax.servlet.http.HttpServletRequest request)


but vhe I call from an execute method:

return mapping.findForward( "/secure/customeredit.jsp" );

my fields remain full of old data.

Does anyone know a solution?

Andrew Hill wrote:

>The scope into which struts places the ActionForm instance is defined by you
>in the struts config file in the action definition. For example in the
>follwing action definition thingy the "scope" attribute states to use the
>request context. If you specify session, then the session context will be
><action path="/login"
><forward name="success" path="/global/"/>
><forward name="failure" path="/new/world/"/>
>To have your fields reset to default values when a request is made, you may
>override the reset() method in ActionForm and set the default field values
>there. (If you are using any checkboxes you will want to do this anyway to
>set them to false).
>The signature of the reset() method is:
>public final void reset(ActionMapping mapping, HttpServletRequest request);
>This is called by struts before it populates the ActionForm from a request.
>-----Original Message-----
>From: kiuma []
>Sent: Thursday, September 19, 2002 21:44
>To: Struts Users Mailing List
>Subject: [STRUTS] Cleasing form fields fields
>how can I have a clean form field the second time I visit it?
>It seems it keeps data into session. How can I clean those fields,
>without cleaning other informations?
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>To unsubscribe, e-mail:   <>
>For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message