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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:05:19+00:00 2026-06-06T02:05:19+00:00

I have code in a managed bean: public void setTestProp(String newProp) { FacesMessage yourFailure

  • 0

I have code in a managed bean:

public void setTestProp(String newProp) {
   FacesMessage yourFailure = new FacesMessage();
   yourFailure.setDetail("Really you need to promise to never do that again!");
   yourFailure.setSummary("Stop here, now!");
   yourFailure.setSeverity(FacesMessage.SEVERITY_FATAL);
   throw new ValidatorException(yourFailure);
}

and in the XPage:

<xp:messages id="messages1" layout="table" showSummary="false"
    showDetail="true" globalOnly="false">
</xp:messages>

but I get as result message (nicely in the yellow box as expected, not in an error page):

Error setting property 'testProp' in bean of type com.ibm.sg.demo.Test: javax.faces.validator.ValidatorException: Stop here, now!

I would like to:

  • not have the technical part
  • see the summary

What do I miss?

  • 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-06T02:05:20+00:00Added an answer on June 6, 2026 at 2:05 am

    The problem is that the property resolver catches all java.lang.Throwable from the get/set method of the managed beans. The “original” facesMessage is replaced with a new one (the previous message is appended).

    You have three possibilities:

    1. Create your own property resolver
    2. Create your own validator and attach it to the field binded to the managed bean
    3. Add a validation method to your bean

    Hope this helps

    Sven

    EDIT:

    How to add a validation method to your bean

    a) Add a validation method to your bean

    public void validate(FacesContext context, UIComponent toValidate,  Object value){
    
        // Do your validation with value
        // if everything is ok, exit method
    
        // if not, flag component invalid...
        ((UIInput)toValidate).setValid(false);
    
        // ... create your message ...
        FacesMessage yourFailure = new FacesMessage();
        yourFailure.setDetail("Really you need to promise to never do that again!");
        yourFailure.setSummary("Stop here, now!");
        yourFailure.setSeverity(FacesMessage.SEVERITY_FATAL);
    
        context.addMessage(toValidate.getClientId(context),  yourFailure);
    }
    

    b) Add your validator to the field

    <xp:inputText id="inputText1"
    value="#{TBean.test}"
    validator="#{TBean.validate}">
    

    (You can name the method whatever you want.)

    This validator has not to be added to the faces-config.xml.

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

Sidebar

Related Questions

I have new problem. My code: .method public static void Main() cil managed {
I have the following code: JSF Managed Bean: @ManagedBean(name = purchaseView) @ViewScoped public class
I have this java code which is a part of a managed bean which
Well I have this code in my Managed C++/Cli in Visual Studio 2008, I
I have managed to crunch down a several line code to this For Each
If I have managed COM interface called from unmanaged code, am I responsible for
So far I have managed to write some code that should print the source
I am trying to parallelize my code using openmp. I have managed to parallelize
I have a session scoped managed bean, with a property current . If I
I have a JSP with a managed bean. I want to display a message

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.