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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:05:21+00:00 2026-05-20T01:05:21+00:00

I need to override the default conversion messages So, I m trying to make

  • 0

I need to override the default conversion messages
So, I m trying to make a custom conversion error interceptor for my application which would be called instead of struts default interceptor
Below mentioned is the code for that

public class MyConversionErrorInterceptor extends ConversionErrorInterceptor {

private static final long serialVersionUID = 1L;

protected Object getOverrideExpr(ActionInvocation invocation, Object value) {
    ValueStack stack = invocation.getStack();
    return (String)stack.findValue("myproj.item");
}
protected boolean shouldAddError(String propertyName, Object value) {

    return true;
}}

Here is the struts.xml configuration mentioned.

<interceptors >

<interceptor name="conversionError" class="com.celtic.cmvs.webapp.interceptor.MyConversionErrorInterceptor" />

<interceptor-stack name="myDefaultStack">
    <interceptor-ref name="conversionError" />
    <interceptor-ref name="defaultStack"/>
</interceptor-stack>

But it doesn’t work.
Thanks in advance

  • 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-20T01:05:22+00:00Added an answer on May 20, 2026 at 1:05 am

    I see a few possibilities.

    1. The struts2 conversionError interceptor is still going to be called. If you want yours instead of the standard one, you need to define the entire stack yourself, with your interceptor in place of the standard one.
    2. You might want to change the configured name of the custom interceptor so that it is not the same as the standard one. Otherwise, interceptor-ref name=”conversionError” may still be pointing to the standard interceptor.
    3. You need to make sure that your new stack is used. You can do that either by declaring it as the default stack, or by referencing the custom stack inside a specific action.

    I have a tutorial on custom interceptors in my blog that may be useful: http://ddubbya.blogspot.com/2011/01/creating-custom-struts2-interceptors.html

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

Sidebar

Related Questions

I am trying to override the DateTime template since I need custom class names
I strongly need to override JSF 2.0 Content-Type header. Default it is Content-Type:application/xhtml+xml; charset=UTF-8
Someway to override Delphi default procedures at Design Time ? I need to override
I want to override the default android messaging application. If I receive a sms
So i have a ASP.NET 4 Custom Control called SafeClickButton which is designed to
I need to send hundreds of newsletters, but would like to check first if
I am trying to revamp our build process, which is currently a gigantic Ant
How can I override TinyMCE's default formatting for basic stuff like bold, underline, and
I'm trying to create a default handler for .p7s/.p7b files in Android. I figured
I need to solve the following question which i can't get to work by

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.