Overriding JBO messages from JHS resource bundle

Hello,
JHS 10.1.2.0
in you jhsdevguide.pdf on page 3-97 the page end with the following text
-- start of text
Suggestion: You can override the text for several types of messages (for
example JHS- or JBO-errors) by specifying the error code as an entry in the
Resource Bundle. Make sure you compile (rebuild) the class after making any
additions; otherwise you might lose them the next time you run JAG.
-- end of text
I was able to get the JHS- messages to work, however I had no sucess with JBO- messages.
Do I need to do something extra/ different?
regards
Sanjiv

Sanjiv,
The documentation is wrong in the sense that it does not apply to JBO message. To customize JBO error messages, you can follow the steps as descroibed in the JDeveloper online help topic "Customizing Error Messages", which can be found under Building J2EE Applications -> Working with the Business Tier -> Developing ADF Business Components -> Implementing Business Logic -> Implementing Validation Logic -> Handling Exceptions.
Steven Davelaar,
JHeadstart Team.

Similar Messages

  • Overrid JBO messages in multiple languages

    Hello,
    platform : JDev 10.1.2 with UIX
    We need to have custom error messages for my application.
    In Jdeveloper help in section 'Customizing Error Messages ' the mechanism to override existing JBO messages in well documented.
    BUT. How to translate these messages to another language, French in my case?
    because I get the default JBO French message.
    Any pointers and sample code will also be helpful.
    regards
    Sanjiv

    For displaying message, it better to use message class instead of using otr.
    Using transcation se91 create a message class and messages, this can be called in WDA
      get message manager
      DATA lo_api_controller     TYPE REF TO if_wd_controller.
      DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
      lo_api_controller ?= wd_this->wd_get_api( ).
      CALL METHOD lo_api_controller->get_message_manager
        RECEIVING
          message_manager = lo_message_manager
      report message
      CALL METHOD lo_message_manager->report_t100_message
        EXPORTING
          msgid                    = (Name of the Message Class)
          msgno                    = (Message Number)
          msgty                    = (E - Error, W - Warning...)
         p1                       =
         p2                       =
         p3                       =
         p4                       =
         msg_user_data            =
         is_permanent             = ABAP_FALSE
         scope_permanent_msg      = CO_MSG_SCOPE_CONTROLLER
         view                     =
         show_as_popup            =
         controller_permanent_msg =
         msg_index                =
         cancel_navigation        =
    This will display the message in logon language.
    Thanks
    Vishal

  • Resource Bundle message in EL

    Hi out there,
    I would like to use a message from a resource bundle in an Expression Language expression. In the Java EE 5 Tutorial i saw, that a ResourceBundleELResolver exists that seems to do that, but I don't get it to work.
    Here is what I would like to have:
    <fmt:setBundle basename="my.own.cool.Bundle" var="myBundle" />
    <!-- ... -->
    ${myBundle.myKey}This doesn't work. Can anybody please point me to the right way?
    Thank you!
    Peter

    What server are you using? Does it support JavaEE5?
    The ResourceBundleELResolver seems to be a feature of JSP2.1, and as such is only supported by the newest containers.
    <fmt:message/> tag is probably better to use.
    You can export the result to a var and use that var in an expression.
    ie
    <fmt:message var="result" key="${myBundle.myKey}"/>
    ${result}Ok, so its not the cleanest solution, but it should work.

  • Trouble resolving resource bundle message with validator.

    Hi,
    I'm using an af:validateDateTimeRange component (with only a minimum date), and want to change the validation message that is displayed to a custom message.
    I have this message in the resource bundle, but the component does not seems to pick it up, and just uses the default message instead. The only ways I've got it to display the correct message are :
    - Hardcoding the message into the minimumMessageDetail attribute (currently done this way).
    - binding the minimumMessageDetail attribute to a managed bean's property.
    Is there any reason why it's not picking up the message from the resource bundle? (Yes, the resource bundle is set up correctly - it's used everywhere throughout the application.)

    Ok my diagnosis of this is that references to keys in a property bundles from the attributes
    maximumMessageDetail
    minimumMessageDetail
    notInRangeMessageDetail
    Do not work. Hardcoded values work in notInRangeMessageDetail, but not the other two - does that agree with what you see?

  • Access Resource Bundle Data Programmatically

    JDeveloper 11g 11.1.1.2.0
    We've encountered a scenario where we also want to set messages being thrown from our java objects (Impl classes or Beans) to use messages from the resource bundle as data to be thrown.
    Is there a utility or a class that can easily give us access to the xliff document which will allow us to just get by id?

    You can access the resource bundle in the Model as shown below:
    import java.util.Locale;
    import java.util.ResourceBundle;
       ResourceBundle params =
           ResourceBundle.getBundle("com.bundle.location", Locale.getDefault());
       String value = params.getString("someKey");
    ...

  • Allowing EL expression in a resource bundles

    Mojarra 2.1.7-jbossorg-1 (20120227-1401)
    JBoss 7.1.1
    EL expressions in a resource bundle are currently not evaluated. That is, an an example, I have the following in the requiredMessage attribute of a JSF input control:
    requiredMessage="Status for #{someBean.documentMap[claimDocument.id].description} is required."I would like to move this to a messages.properties file like so:
    required.claimDocumentStatus=Status for #{someBean.documentMap[claimDocument.id].description} is required... so that the requiredMessage attribute becomes:
    requiredMessage="#{msg['required.claimDocumentStatus']}"Now the output for h:message(s) is
    Status for #{someBean.documentMap[claimDocument.id].description} is required.As I have found out, JSF resource bundles does not resolve EL expressions:
    http://stackoverflow.com/questions/6547136/el-variable-in-jsf-resourcebundle
    What I am trying to do is to allow such resolution / resolving to take place for JSF resource bundles. Now there is a class called "javax.el.ResourceBundleELResolver". I was wondering what it would take to extend this class to allow such a thing to take place. There does not seem to be a way to override it or to specify a custom resolver via faces-config.xml.
    Any thoughts ?
    Edited by: jmsjr on 14-Jan-2013 21:53

    jmsjr wrote:
    gimbal2 wrote:
    IMO this requirement, if it is possible to implement, is only going to lead to a hard to maintain application. But I guess that's something you have to experience before you believe it.
    You can't use EL directly in a resource bundle out of the box, but it is possible to parametrize them anyway, did you know that? Perhaps that is already good enough for you.
    http://murygin.wordpress.com/2010/04/23/parameter-substitution-in-resource-bundles/
    http://stackoverflow.com/questions/5697189/pass-parameters-to-messages-from-resource-bundle-to-components-other-than-hou
    Yes, I am aware of parameterising the resource bundles. However, these require you to use f:param .. and the last time I tried, these parameters were not available / visible at the requiredMessage attribute. I'll try it again anyway.As I have re-discovered, you cannot parameterise the requiredMessage attribute.
    http://stackoverflow.com/questions/9280915/how-to-parameterize-requiredmessage-attribute-in-composite-component
    The other alternative I am looking at, for the cases where the requiredMessage needs to be parameterised, or needs to have dynamic content, is to call a backing method for the requiredMessage attribute, from which I can then do whatever I need, even use EL expressions. I was thinking of this as a last resort.
    On the other hand, when one uses the validator attribute, usually one ends up adding one or multiple FacesMessage in code within the method being called, where the string of the message already comes from a resource bundle. I was trying to have a delineation whereby:
    1) requiredMessage should only use resource bundles, no backing bean method called.
    2) FacesMessages added via the method called by the validator attribute is OK

  • How to use a resource bundle in viewcontroller project

    How can I create a resource bundle for a viewcontroller project ? Is there any way to add entries to it other than adding manually editing the property file ? so that all the key generated will be unique? How to access a message in the resource bundle in my backing bean so that I can display it in my screen ?
    Thanks
    Suneesh

    Suneesh Raman wrote:
    How to access a message in the resource bundle in my backing bean so that I can display it in my screen ?Take a look at this: http://adfcodebits.blogspot.com/2010/04/bit-5-accessing-resource-bundle-from.html

  • Getting String using ResourceBundle and XLIF resource bundle.

    Hello,
    I am using Jdev. 11.1.1.2.0. I am trying to use XLIFF resource bundle in the Model project and trying to get string from the bundle using following code. I am getting MissingResourceException. if I use Property Bundle, it works fine.
    public String getMessage(String code)
    return ResourceBundle.getBundle("model.ModelBundle").getString("MESSAGE1");
    Any help to make it work with XLIFF resource bundle will be appreciated.
    Thanks,
    Amit
    Edited by: Amit Patel on Apr 1, 2010 10:23 AM

    To get the values from the resource bundle, you use the <fmt:message> tag
    <fmt:message bundle="${appbundle}" key="lbl.accountnum"/>

  • How to configure resource bundle in facescontext.xml in JSF

    I have to take each label from the resource bundle in my web application, so how to configure resource bundle in JSF and how to use it, so please help me.....

    Follow the below mentioned steps ::
    1) make a properties file say mymessages.properties alongwith your java files. Put content like
    click=Click Me !!!
    #where click is the key and Click Me !!! is the actual value that needs to be displayed
    2) Add in faces-config.xml like this ::
    <application>
              <message-bundle>mymessages.mymessages</message-bundle>
         </application>     
    3) Use in your jsp page like this ::
    <f:view>
    <f:loadBundle basename="mymessages/mymessages" var="msg"/>
    hello :: <h:commandButton value="#{msg.click}" onclick="callJavaMethod()"></h:commandButton>
    </f:view>

  • Java: Loading Resource Bundle File with UTF-8

    I have found out all my previous problems now, thank you all for your assitance with this...
    During the time we have worked so solve our problem with UTF-8 charset we have found new problem with this?
    I don't know if this is the right forum to put this up, if not please let us know where to go with this?
    I have prepared both Eclipse (JSP Files) and GlassFish to run all my files in charset UTF-8. Then i got my
    resource bundle files(property files) to use UTF-8 encoding. Everything looks fine in my text editor. Then
    when i upload these pages every character retrieved from my resource bundles look garbled. This is because
    Java loads property files using ISO 8859-1 character encoding.
    This is a problem from Sun i have read on the internet!
    Note: that in JDK 1.6, you can use PropertyResourceBundle constructor to take a Reader which uses UTF-8 encoding.
    please have a look at these links for more info:
    [http://www.kai-mai.com/node/128]
    [http://java.sun.com/javase/6/docs/api/java/util/PropertyResourceBundle.html]
    Note: PropertyResourceBundle can be constructed either from an InputStream or a Reader, which represents a property file.
    Constructing a PropertyResourceBundle instance from an InputStream requires that the input stream be encoded in ISO-8859-1.
    In that case, characters that cannot be represented in ISO-8859-1 encoding must be represented by Unicode Escapes,
    whereas the other constructor which takes a Reader does not have that limitation.
    What i have read and understand is that the real solution to the problem is: Get the fmt lib to use a Reader instead of an
    InputStream. Alternativly if it works get a ResourceBundle instead of creating one that is wrong all the time? I have to create
    my own ResourceBundle instead of using my own fmt lib wich i cannot trust in a way any more. Is this right or am i comletly wrong?
    My WebTexts files, en, sv and ry are my resource property bundles. To be able to read them i will use resource property bundle reader.
    Fmt lib gives me this but it seems that it inciates this in an InputStream (wich is looked to iso-8859-1) instead of a reader who can
    read UTF-8 without no problem. So can i get my fmt lib to change this or not, anybody have an idea about this???

    Torleif wrote:
    Ok, i know there are a few ways of doing this already. The problem is that i have no idea how to use these different problem solving issues. First we have the;
    1. native2ascii command line utility.
    2. use the XML properties format.
    3. other ways of converting from iso-8859-1 to utf-8.
    The last one i have tried already but i never get this to work. So after knowing of 2 standardized solutions you choose to implement your own non-standard soltion? That's usually not a good idea until you've verified that the standardized solution don't help.
    This is also not the best solution to the problem i have to say. This way i will have both properties files and source files to work with and that is to much i think. Either i will use the native2ascii command or use XML properties format like you say here. I need some more insight in how these two work only because i have no idea my self.Uhm .. read [the documentation|http://java.sun.com/javase/6/docs/api/java/util/Properties.html]? loadFromXML/storeToXML work pretty much exactly the same as load/store, except they handle XML. Try it, look at what it produces, learn.
    Could you please help and explain how to use either this native2ascii command line work or how this XML format properties would work for me. Please i need guidance here with this!!![native2ascii is documented as well|http://java.sun.com/javase/6/docs/technotes/tools/windows/native2ascii.html].
    If you have a specific question after reading those, feel free to ask here.
    You really have to work on your Google-fu, it seems to be too weak.

  • Resource Bundles in source missing

    I can't seem to locate any resource bundle properties files in the source...isn't this available also?  I need to change some labeling, specifically:
        _label.text = Localization.impl.getString(ROLE_STRINGS[_data.role]);
    thanks,
    David

    Hi there,
    In order to be Flex-independent, we had to build a Localization Framework
    that didn't depend on resource bundles. That said, you should be able to
    plug resource bundles in pretty easily.
    Localization.impl = new MyLocalizationManager();
    Then, make a MyLocalizationManager class which implements
    ILocalizationManager - the method you specifically need to implement is
    getString(). You can pull the string from your resource bundles in that
    method.
      nigel

  • [svn:fx-trunk] 12663: Adding the resource bundle and fat-swc targets for osmf and textlayout.

    Revision: 12663
    Revision: 12663
    Author:   [email protected]
    Date:     2009-12-08 12:22:31 -0800 (Tue, 08 Dec 2009)
    Log Message:
    Adding the resource bundle and fat-swc targets for osmf and textlayout.  Also for osmf adding the doc target.  This new format that I added to the two project build files will be what we will use going forward for all projects.  I have all the other projects modified and plan on checking them in soon.  The format change will make adding new locales easier as well as adding the fat-swc target when needed.
    QE notes: no
    Doc notes: no
    Bugs: no
    Reviewer: gaurav
    Tests run: checkintests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/build.xml
        flex/sdk/trunk/frameworks/projects/osmf/build.xml
        flex/sdk/trunk/frameworks/projects/textLayout/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/osmf/bundles/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/osmf.properties
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/textLayout.properties
    Removed Paths:
        flex/sdk/trunk/frameworks/projects/osmf/src/OSMFDocClasses.as
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/empty.properties

    Thats good news.

  • Portlet resource bundle

    Hi,
    I have written and deployed a portlet.
    which works very fine with the default language (english)
    I want to make the same portlet available in multiple languages, rather I want to provide internationalization over this.
    I have prepared a resource bundle to tackle the scene.
    I have few questions based on this -
    1. Where do I put this resource bundle file
    2. Will the portal server be able to pick the title of the portlet from the resource bundle.
    Any pointers to this will be highly appreciated.
    Thanks,
    Abhi

    Please check portal developer doc http://docs.sun.com/app/docs/doc/817-7695 from p.83 to 85
    How to add resource bundle into portlet war file and deploy. Jerry

  • WebCenter Spaces: Customise Resource Bundles?

    Does anyone know if and how the webcenter spaces resource bundles may be customised or overridden?
    I need to rename the "My Group Spaces" tab to a custom name. I see that the label is obtained (within webcenter java code) from a resource bundle "oracle.webcenter.webcenterapp.resource.WebCenterResourceBundle".
    Thanks in advance,
    Bijesh

    Read this white paper: http://www.oracle.com/technetwork/middleware/webcenter/owcs-r11-extend-spaces-wp-132596.pdf
    Page 42: Renaming the personal space tab.
    The paper should also explain how to create your own resource bundle.

  • Resource Bundling question.

    Hi,
    I have a message in my resource bundle say:
    static final Object[] messages_ =
    { T2zosMessageKeys.MYDETAILS_,
    " My name is = {0} and my age is "{1}"},
    My question is when I invoke this message in my resource bundle , how do I supply the parameters to the arguments {0} and {1}?

    Well, if that's your resource file, I would say you need some sort of method to search and replace those parameters in the string.

Maybe you are looking for