Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:54:02+00:00 2026-06-13T21:54:02+00:00

I am migrating a project from struts 1.3 to struts 2.0. Now I have

  • 0

I am migrating a project from struts 1.3 to struts 2.0. Now I have read through various resources available on web but could not find a struts 1.3 reset() form method alternative in struts 2.0.

My action class extends ActionSupport and implements Modeldriven. I have implemented the validate method in action class and that works perfect. However, when the form has no errors and the submission is done properly, the page reloads with initial values.

I expected that I will receive a blank form. I looked for a reset() form method but could find none. Currently, I am explicitly setting all form values to blank. I don’t see this as a good programming practice. Please suggest how to implement form reset() in struts 2.0.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:54:04+00:00Added an answer on June 13, 2026 at 9:54 pm

    EDIT: ok, you are working with Tiles (that I’ve never used), then I’ll try another solution:

    if you have an empty JSP tile, and after the user compiled its fields and submitted the form, you want to ALWAYS clear those fields… what about declaring only SETTERS in the Action, and not the GETTERS ?

    You could only set from JSP to Action, but not read them from the JSP… then your fields will be always empty in the page, and always rewritten by setters in the Action.


    If i got it, you are on JSP, you call the method saveStuff() of the Action (or of another action), then you come back to the page…

    in this case, you can use a RedirectAction return type, that will strip all params from the request, and redirecting your request to the execute() method of your Action.

    So, instead of

    <action name="myAction" class="com.blabla.myAction">
            <result name="success">/myPage.jsp</result>
    </action>
    

    just do

    <action name="myAction" class="com.blabla.myAction">
          <result name="success">/myPage.jsp</result>
          <result name="stuffSaved" type="redirectAction">
              <param name="actionName">myAction</param>
          </result>
    </action>
    

    This way you re-enter in the initial state (assuming you are not putting anything in session that is read by the JSP).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large-ish web project which is migrating from classic ASP to ASP.NET
I am migrating a django project from 1.1.1 to 1.2.1 Now neither the {%
I am migrating a project from NHibernate 1.2 to Nhibernate 2.1, and I have
I have these two file in my project that I am migrating from php.
We are currently migrating a project from QTP to Selenium. We have a few
I'm currently migrating my project from PHP (codeigniter) to Rails3 and it's amazing. But
I'm migrating a project from another system to github. We have many old releases
I am migrating a small C++/CLI project from VS2008 to VS2012, and have run
I have a problem migrating from Delphi 2006 to Delphi 2009. A Project which
I have a Flash builder project that I am migrating from SDK 4.1.0 to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.