facebook

How to initialize the form?

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #241685 Reply

    yhqian2005
    Member

    1. I have a struts form in a config.jsp page. when this jsp page is loaded through web broswer I need to initialize each field with values and these values are read from a properties file.

    2. The user can update each field and then click submit of config.jsp, all the entered values will be automatically populated
    to ConfigForm and sent to ConfigAction which save the values to the properties file.

    3. Next time when the config.jsp is loaded, the form is initialized by the parameters from step 2.

    My question is how to initialize the form ( with the values from a file in my case)?

    Thanks.

    #241709 Reply

    reset method will be called whenever the form gets loaded. Probably you can use this method to do your initialization, I guess.

    -Sun

    #241727 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    #241746 Reply

    yhqian2005
    Member

    I have found the way to solve this problem.

    I need to use the reset() method of ActionForm , but the trick is I need a Setup Action triggering the reset() method. This does not require any coding in the setup action, all that the Setup Action class need to do is to forward the user’s request to the test.jsp file.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: How to initialize the form?

You must be logged in to post in the forum log in