Trying to display an error message on my JSF page

Hi,
I'm very new to JSF and hopefully this will be easy to answer. I'm trying to display an error message when a user fails to login correctly. I have this on my login page:
<h:message for="userid" id="inputError"></h:message>
and in the login bean that handles the login, I invoke this method when the login fails, passing in the appropriate error string
     private void setError(String error) {
          FacesContext ctx = FacesContext.getCurrentInstance();
          FacesMessage fm = new FacesMessage();
          fm.setSeverity(FacesMessage.SEVERITY_ERROR);
          fm.setSummary(error);
          fm.setDetail("ERROR: " + error);          
          ctx.addMessage("userid", fm);
But the error is not displaying upon a failed login and so I'm wondering if there is something more I need to do. Your help is appreciated, - Dave

To get the "real" client id use
ctx.addMessage(myComponent.getClientId(ctx), fm);and bind the userid input text to your backbean
view code:
<input binding="#{bean.myComponent}" ...backbean code:
private UIInput myComponent;
// getter/setter
public UIInput getMyComponent() { return this.myComponent; }
public void setMyComponent(UIInput myComponent) {
    this.myComponent = myComponent;
}I hope this helps...

Similar Messages

  • Display Custom Error Message in OIM 11g

    Hi,
    I'm trying to display an error message from a validation event handler but seems that am missing something. When the "oracle.iam.platform.kernel.ValidationFailedException" is thrown from a validation handler an error message is displayed: "An error occurred". If an error code is provided (see code below) then the message looks like: "An error occurred. The corresponding error code is ERR-0001". I guess that some resource bungle with corresponding messages should be provided.
    the code used:
    package test;
    public class UserGeneralValidationHandler implements oracle.iam.platform.kernel.spi.ValidationHandler
    @Override
    public void validate(long processId, long eventId, Orchestration orchestration)
                   throws ValidationException
    String errorCode = "ERR-0001";
    String message = "Simple validation message.";
    ValidationFailedException ex = new ValidationFailedException(message);
    ex.setProcessID(processId);
    ex.setErrorCode(errorCode);
    throw ex;
    Q:
    1.What is missing for complete solution?
    2.What is the algorithm that used by OIM to find default or non default resource bundle?
    3.How to change out-of-box validation messages? For a sample "The organization ABC does not exist." message is shown if non existing organization is provided during user creation and I'd like to have a different one.
    Regards
    Serge

    rename OIMUI.jar  to OIMUI.zip
    find logging_en and loggin.properties.
    Modify the "IAM-2050512" error message with your custom message
    Find Agent and agent_en.properties.
    Find Note[ERROR_SUBMITTING_REQUEST].text.  Modify the message. Make sure the message must be the same with in logging.properties("IAM_2050512")
    Deploy
    change the  OIMUI.zip to jar
    replace the existing OIMUI.jar
    login to weblogic  and redeploy OIM (oim.ear)
    no need to restart OIM server.
    Test:
    create a request in web console again, you must see the custom message when you hit the submit button
    hope this helps.
    -rad

  • TS1389 I cannot sync my iPhone with iTunes for Windows. Even if the computer is authorized, it keeps on displaying an error message that tells that this computer is not authorized. I already tried to do the resolutions you have given in case this situatio

    I cannot sync my iPhone with iTunes for Windows. Even if the computer is authorized, it keeps on displaying an error message that tells that this computer is not authorized. I already tried to do the resolutions you have given in case this situation happens.

    It's an endless circle.
    See if these instructions help: iTunes repeatedly prompts to authorize computer to play iTunes Store purchases

  • TS2529 I am trying to set up a new iphone to my old iphone's settings. When i have tried to back it up it displays a error message saying that it cannot back up because the back up was not saved. Anyone have any ideas?

    I am trying to set up a new iphone to my old iphone's settings. When i have tried to back it up it displays a error message saying that it cannot back up because the back up was not saved. Anyone have any ideas?

    First backup the old phone to iTunes using right mouse click then backup after that restore from backup on the new device .

  • While trying to import photos from my Canon 5D markIII, iPhoto displays an error message which says unreadable format and the following files could not be imported. Please advise???

    While trying to import photos from my Canon 5D markIII, iPhoto displays an error message which says unreadable format and the following files could not be imported. Please advise???

    the screen shot does not display (a Forum bug ) and if it did it does not answer the questions
    Seriously we can not see you and if you refuse to answer simple questions we can not help
    Need information to help
    what version of iPhoto? Is OS X 10.8 as you state correct for the OS? Has it ever worked? What has changed since it worked? Will Image Capture  ( in your applications folder) import the photos? How are you importing - USB to the camera? USB card reader? built in card reader?
    Any other clues that would help a total stranger who can not see you or your computer assist you?
    LN

  • HT5654 I performed the update to my iphone to get the latest version, but now it does not want to activate my phone and displays the error message that the activation server is not available. Tried itunes and no luck. help anyone

    I have an iphone 3gs of which I attempted the latest IOS pdate through itunes. Now, it shows the original start up screen and when it gets to the activiaton screen it displays an error message stating: Your iphone could not be activated because the activation server is temporarily unavailable.  Help anyone??

    "We're Sorry, Activation Server Temporarily Unavailable, contact Customer Care?"
    99.9% of the time, the cause of this issue is the fact the phone was jailbroken/hacked to unlock it for use on networks other than the network the phone was originally locked to. Apple maintains a database of officially unlocked iPhones, and when Apple's servers detect phones such as yours, activation stops & you get the message you got.
    So, you need to get a sim card from the carrier the phone was originally locked to, or get it officially unlocked, if you want to activate it. Because it appears that it was not officially unlocked.

  • ICI - How to display custom error messages in SAP CRM

    Hello,
    we are working on a custom Contact Center which interfaces with SAP CRM Version 7 with Enhancement Package over ICI.
    The basic call functions like accepting, hanging up, holding and retrieving are fully implemented and are working already.
    Our goal is to display error messages in the CRM so that clients know there is something wrong, for example why he can't be log in successfully (e.g. the telephony server isn't reachable).
    We already found the ICI Documentation file which provides us the CRM SOAP error codes and tried to send SOAP Fault messages, but never got
    them to screen.
    Please find an attached example screenshot what we mean exactly, reproduced by trying to make a call with CRM user while BCM CDT isn't
    running in the background.
    Regarding to this topic we've the following questions:
    - Is it possible to display custom error messages on the CRM or is this functionality limited to SAP?
    - Could you provide us some further information on how to use this feature exactly (implementation details?) and how the SOAP XML should look like to get it work?
    Thank you in advance!
    Best regards
    René Holy

    NewUser7 wrote:
    Please correct me if I am wrong
    I need to create an entity adapter and attach an error handler with the adapter? or can i handle that in the event handler itself. I coulnt find any api for handling errorsYou can do it both ways but since we are talking about event handler now, then in 9.x you need to extend com.thortech.xl.client.events.tcBaseEvent class for creating a event handler. In tcBaseEvent class there are various flavors of handleError method. So use that as per my note earlier and you should be good.
    HTH

  • ITunes displays -48 error message when syncing iPod Nano on Windows XP

    My girlfriend's mom's iPod Nano ran out of charge while jogging so she decided to charge it on her daughter's iHome. The next day she went to use her iPod but it was totally empty of all music and files. When she tried to sync it to iTunes, she received an eror message stating, "An unknown error has occurred (-48)" from iTunes and a Windows message stating that some iPod folder/file was corrupted.
    If anyone receives such a message, I was able to correct it by:
    -Plugging in your iPod to your PC
    -Ignore the error messages
    -Go to My Computer
    -Find your iPod's drive letter (ie. G:)
    -Right-click on it and select Properties
    -Go to Tools Tab >Error-checking and select Check Now
    You should be able to sync your iPod as before. I do not claim to be an expert so be warned that it may not work for you. Good luck!

    Hey ermides,
    Thanks for the question. The following resource provides information if you are receiving a -50 error message when syncing:
    iTunes displays -50 error message when syncing iPod on Windows XP - Apple Support
    http://support.apple.com/en-us/ts1539
    Thanks,
    Matt M.

  • ITunes displays -50 error message when syncing iPod on windows 7

    I am trying to sync my ipod and appears this error
    iTunes displays -50 error message when syncing iPod

    Hey ermides,
    Thanks for the question. The following resource provides information if you are receiving a -50 error message when syncing:
    iTunes displays -50 error message when syncing iPod on Windows XP - Apple Support
    http://support.apple.com/en-us/ts1539
    Thanks,
    Matt M.

  • Display an error message in Portal during creation of Object Link

    Hi,
    I have a requirement where I need to throw an error message in Portal during creation of Object Link.
    The requirement is whenever the user clicks on Item and try to create a Object Link for Material-Plant combination, if the Mat-Plant combination exist, than I have to throw/display an error message.
    I tried for some enhancements in BAPI_BUS2172 but it does not work out.
    Please help.
    Thanks in advance.
    Arbind

    Hi,
    If you include the UI, it will display at the top of the screen..
    Please see below how to create a message in the message editor.
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    and this is how you access the error message in the application ti display it to the end user
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    Regards,
    Ganesh N

  • How to display an error Message in Web Dynpro

    Hello,
    I want to display an error message in Web Dynpro. I'm using this,
    IWDMessageManager message = wdComponentAPI.getMessageManager();
    message.reportSuccess("<some relevant debug message>");
    However, the message is always shown at the bottom of the screen. It is possible to select the location in the screen for showing this object? Or what is the best way for doing this? I've tried to use a Label but I can't set the type (warning, error, info) it's only a message.
    Thanks
    Regards
    SU

    Hi,
    If you include the UI, it will display at the top of the screen..
    Please see below how to create a message in the message editor.
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    and this is how you access the error message in the application ti display it to the end user
    http://help.sap.com/saphelp_nw04/helpdata/en/72/1d6526263ff24995016a152705eab2/frameset.htm
    Regards,
    Ganesh N

  • HTMLB control for displaying clientside error messages

    Hi all,
    I want to display client side validation error messages in a JSP DynPage.I have tried MessageBar but it can't be accessed from JavaScript file.Becuase of that i couldn't write error messages from .js file using MessageBar.Can U plz tell me is there any other HTMLB control or other way to display clientside error messages.
    Urgent
    Thanks
    Sampath.G

    Hi Sampath,
    I have an idea to use message bar in client side.
    1.First create a div at the begining of a page which is always visible.
    2.create some hidden div tags which contains message bars with different error or information messages.
    3. during the validation in javascript if u want to show error message just assign the content of hidden div tag
    to visible div tag.Now u will get error message as like real message bar.
    Then in javascript just write this code
    document.getElementById('sample').innerHTML=document.getElementById('Error').innerHTML
    where sample-->id of visible div
    Error-->id of hidden div inside which u need to write the code for messagebar
    this wiil show the error message at the place of visible div (sample).
    <b>Note:</b>
    If u want to change the messageBar text dynamically that can be possible only through server side only using bean to set and get error messages.
    I am not able to give some sample coding since the code button throws some script error.
    Ragards,
    Tamil K

  • Displaying Custom Error Message in ALV

    Hello Experts,
    Usually, when an error occurs in editable ALV, the standard WD ALV functionality marks the particular error cell in red and displays the error message.
    I want the same functionality for custom error messages in event ON_DATA_CHECK. I'm able to display the message, but looking for a way to mark cells as well.
    Please help....

    Hello friend,
    I think this link will help you much more clear on the coloring of the ALV concepts.
    http://help.sap.com/saphelp_smehp1/helpdata/en/5f/ec57c72a1349c8bfdda56d976e9399/frameset.htm
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0625002-596c-2b10-46af-91cb31b71393?QuickLink=index&overridelayout=true
    Thanks,
    Sri Hari

  • Display custom error message in enhancement spots

    Hi all,
    Is there someone here who've encountered having the need to display custom error message in an enhancement spot? Could you help me please.. I can't find any reference from the net.
    Thanks in advance
    Regards,
    Aris

    Hi,
    The error message can be only displayed in enhancement spots based on thr program flow.
    You have to determine where its getting called for ex: in PBO or PAI etc.....
    You have to find the right place to display the error messages . for ex: using a memory id ......

  • Display an error message during a few seconds

    Hi!
    When submitting a form, I am displaying a error message saying that the actions performed work fine. Afterwards I would like this message to disappear after a few seconds. How can I do that ?
    in the function called by my action button that submit the form i have:
    public void saveForm() {
    // .... operations ....
    context.addMessage(null,new FacesMessage("Everything is ok"));
    }

    Hi,
    I doubt if there is anything you can do from the action method
    saveForm(), however this you can do it from the client side just
    put some seconds delay in onload method in javascript and
    redirect to some other page.
    Thanks
    Ansar

Maybe you are looking for

  • Report 10.1.2.0.2 - DESFORMAT=spreadsheet - Report does not appear

    We use Report 10.1.2.0.2 - DESFORMAT=spreadsheet RDF Report try to appear for 1 second and then disappear. In the report there isn't image or particular object. There is only one grid from db table. The form coll the report with this procedure: PROCE

  • Problem reading japanese mail subject line

    I am using javax.mail.Message.getSubject() method to read the Japanese subject line of the mail, but when i see the string returned by this method, it has some junk characters. Can anyone please tell me how to read japanese subject line?

  • Depending on the username, show only valid divisions...

    Hello Experts, I was tasked to modify a report wherein in the selection screen only divisions that the user is authorized to use or is under will be shown. For example, I am only authorized for divisions 02, 15 and 16 since they fall in sales org 100

  • How do you download onto the iPod nano????

    Oh my gosh....my patience is wearing VERY thin!!!!!!!......On my instruction pamplet that came along with this nightmare, it said that iTunes would give me easy instructions on how to download music to the iPod. whatever!!!!!!!!!!!!!! how do you do i

  • Actionlistener in swing won't let me play with my variables!

    I am sort of new to java, having done some scripting before, but not much programming experiance. OOP was, until I learned java, something I didn't use that much. All this static and public stuff was hard at first, but I finally think I understand it