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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:20:25+00:00 2026-06-13T07:20:25+00:00

I am encountering a weird error using struts2’s addActionError method. My code in Action

  • 0

I am encountering a weird error using struts2’s addActionError method.

My code in Action Class is:

this.addActionError(e.getMessage()); 
forward = ERROR;

STRUTS.xml:

 <action name="test" class="test">
    <result name="success">/struts/success.jsp</result>
    <result name="error">/struts/error.jsp</result>
    <interceptor-ref name="MyInterceptorStack" />
</action>

where MyInterceptorStack is:

<interceptor-stack name="MyInterceptorStack">
    <interceptor-ref name="alias" />
    <interceptor-ref name="servletConfig" />
    <interceptor-ref name="prepare" />
    <interceptor-ref name="i18n" />
    <interceptor-ref name="chain" />
    <interceptor-ref name="debugging" />
    <interceptor-ref name="profiling" />
    <interceptor-ref name="scopedModelDriven" />
    <interceptor-ref name="modelDriven" />
    <interceptor-ref name="fileUpload" />
    <interceptor-ref name="checkbox" />
    <interceptor-ref name="staticParams" />
    <interceptor-ref name="params">
            <param name="excludeParams">dojo\..*</param>
    </interceptor-ref>
    <interceptor-ref name="conversionError" />
    <interceptor-ref name="DeltaInterceptor" />
    <interceptor-ref name="validation">
            <param name="excludeMethods">
                    input,back,cancel,browse
            </param>
    </interceptor-ref>
    <interceptor-ref name="workflow">
            <param name="excludeMethods">
                    input,back,cancel,browse
            </param>
    </interceptor-ref>
</interceptor-stack>

My JSP:

<div><s:actionerror/></div>

Message should be:
enter image description here

But the result duplicates as follows:

enter image description here

  • 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-13T07:20:26+00:00Added an answer on June 13, 2026 at 7:20 am

    Do you have struts.xwork.chaining.copyErrors = true set in your struts.properties or struts.xml ?

    It would override normal behaviour, giving chain interceptor the ability to preserve action error messages through chains… who knows how it would act with no chains (it’s possible that it copies them the same, assuming you use chain interceptor only with chained results, when this var is set to true)…

    just a try.

    EDIT: can you print out a line from java when you add the message ?

    this.addActionError(e.getMessage()); 
    System.out.println("Setting action error");
    forward = ERROR;
    

    just to check that the action is not called twice for some reason…

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

Sidebar

Related Questions

I am encountering a weird error when using linq-to-sql with ado.net data services. I
I am using Faye in a rails application and I'm encountering a very weird
This is a weird thing I've been encountering and I was wondering if people
I've been encountering a weird problem when receiving the Facebook oauth response string using
I am encountering problems writing XML files using PHP. The following is my php
I'm encountering an odd problem showing .svg using simple img tags on Apache. On
I'm encountering an error sprintf statement. I added a printf command to help investigate,
I am encountering a very strange error with my project. I normally use the
I´m encountering this problem trying to mock some objects that receive complex lambda expressions
I am encountering a potential bug while using jQuery 1.7.1 to animate the height

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.