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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:45:26+00:00 2026-06-09T11:45:26+00:00

I have a class A : class A extends ActionSupport{ int someId; // getters/setters

  • 0

I have a class A :

class A extends ActionSupport{

  int someId;
  // getters/setters

  public String execute(){
    setSomeId(2);
    return SUCCESS;
  }

  public String save(){
   // something
  }

}

In struts.xml, I have configured an action “ViewId” that takes us to the default method execute, where someId is set. Then, we are taken to a jsp page show.jsp where I can access the someId value. In show.jsp, I have to enter an email id and then submit the page. The action that’s now called in “Save” that takes us to the save method of the action class. But, I have given some checks in the corresponding validation.xml file A-Save-validation.xml, which will check the email entered for a format. The problem is that if the xml validation fails, we are taken back to show.jsp, but the viewId parameter is now not available. Why is this so ?

The input page should appear similar to the user as before. Only the fields that are now validated should have an error page associated with them. Any workaround for this ?

  • 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-09T11:45:27+00:00Added an answer on June 9, 2026 at 11:45 am

    Like @Umesh said, validation happens on the corresponding interecptor, before the action’s method is called.

    When validation fails, the action’s method is never called and you will be taken to the INPUT result.

    In order to achieve what you want you have some options:

    1. Implement the preparable interface in your action
    2. Peform the validation inside your method.
    3. Use s:action in your jsp before the items you want populated to call an action that populates the relevant section

    1 is probably the easiest. I like option 3 as well.

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

Sidebar

Related Questions

I have following implementation public abstract class BaseAcion extends ActionSupport { private String result;
i have a class extends asynctask private class taskMK extends AsyncTask<Void,Void,JSONObject>{ String url; JSONObject
This is what I have: class Calendar extends CI_Controller { public $extension; function __construct()
I have class where I draw image. This is code: public class CanvasdrawActivity extends
I have class that extends View. private class Draw2D extends View{ public Draw2D(Context context)
i have public class ExperimentAllInOneActivity extends Activity implements OnClickListener on each button click listener
I have class class User extends BaseModel{ public $id; public $name; } class BaseModel{
I have class Meat extends Food { $var = Food::foodFunction… } I need to
I have a class extends NamedParameterJdbcDaoSupport. well this superclass has a final setDataSource method
Assume, we have: class B class A extends B trait T Then it holds:

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.