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 6330987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:58:25+00:00 2026-05-24T17:58:25+00:00

Its late and im tired, but this problem is bugging me like crazy. I

  • 0

Its late and im tired, but this problem is bugging me like crazy.

I have a form. This form has some input fields that maps to a entity and will be persisted when submitted.
On the same page (but not a part of the form) I have an overview of this entity’s children.

The struts2-Action has a method called edit() that will be run before the form is displayed. This method takes the provided id-parameter and retrieves the complete entity (including children) from the database.
So the form is then displayed nicely with children information.

However. When validation (serverside) has an error. The entity-object does no longer have children. All information (except what was in the form-fields itself) seems to have disappered.

What should i do to still see my children even after validation fails?

  • 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-05-24T17:58:26+00:00Added an answer on May 24, 2026 at 5:58 pm

    It’s late and I’m tired too but off the top of my head:

    I would have avoided the issue probably by using ajax (that is make the action into smaller parts, since one service seems to be unrelated to the other, that is displaying the children need not be tied to updating the entity).

    But that is a lot of work and particularly so if you don’t use ajax. What is really easy is implementing Validateable (or if you extend ActionSupport it already does that) and then adding/overriding the validate method. If you use xml for validation don’t worry both are run.

    Then create a setup method to populate the fields you need, and place it at the right location in the validate method (probably the first line). Since this will always run before execute, it will probably reduce the size of the execute method.

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

Sidebar

Related Questions

Its late and I probably should sleep on this. Easy one I have 3
maybe its late or something, but this is freaking me out. Basicly im writing
it's late, I'm tired, and probably being quite dense.... I have written an application
Its a .vbproj and looks like this <Project DefaultTargets=Build xmlns=http://schemas.microsoft.com/developer/msbuild/2003> <PropertyGroup> <ProjectGuid>15a7ee82-9020-4fda-a7fb-85a61664692d</ProjectGuid> all i
I have this form in my view: <!-- Bug (extra 'i') right here-----------v -->
I might be approaching this problem completely wrong, but I'm still a bit new
OK its late so I must be doing something stupid, but myreduction for loop
Alright so, I have something that looks like this : for (j = 0;
Its been a while I have ready Mcconnell's Code Complete . Now I read
I think it might be that its late and Im just not seeing the

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.