Problem using Resource Bundle in XSLT File

Hi All,
I've been trying to use Resource Bundle on my XSLT file with no success for the last 2 weeks. So I would like some help to definitely end this problem.
The fact is that i have a property file that i would like to read and it works fine when i use jsp or a servlet however when i try to call the same property file using my XSL i get the message below:
java.util.MissingResourceException: Can't find bundle for base name thoth, locale en_US
Follow the code from my Stylesheet that i'm calling the resource bundle:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="java.util.ResourceBundle" exclude-result-prefixes="java" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:output method="html" indent="yes" version="4.0"/>
<xsl:output encoding="ISO-8859-1"/>
<xsl:template match="page">
<html>
<body>
<xsl:apply-templates select="paragraph"/>
<xsl:variable name="resources" select="java:getBundle('thoth')"/>
<xsl:value-of select="java:getString($resources,'general.title')"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet. Should i have to put it some other place? Do i have some other way to read this file and show the information from the file?
I would appreciate any help
thanks in advance and Regards
Fabio

Please someone could help me why this file cannot be located, I am 100% of sure the property file path is in my classpath since it works fine in a servlet.
Is the property file in your classpath? or whether the directory where the property file is residing is in your classpath. Please put only the directory where the property file is located in the classpath and try again.
It may be working fine with the servlet because j2ee servlet containers put the classes and lib directory automatically in the classpath therefore resource bundle gets loaded even without putting it explicitly in the classpath. This doesn't happen when you try to test some component from the console.
Let me know if this does not work.
regards,
Abhishek.

Similar Messages

  • How to use resource bundle entries for column names/title in .rpt file

    <p>Our application needs to be able to support reporting in multiple languages. Hence we do not want to put language specifiec column names in the rpt file but rather use text for a particular locale during runtime which in java world is easily achievable using Resource Bundle entries.</p><p>Does JRC allow for using resource bundle entries as column names or for that matter for titles etc. in the .rpt file?</p>

    Hi,
       You can follow this step-by-step tutorial to find out how to achieve this using our User Function Libraries (UFLs). The walkthrough can be found here:
    <a href="http://diamond.businessobjects.com/node/412">http://diamond.businessobjects.com/node/412</a>
    Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a>

  • Problem in using resource bundle in labels and error message

    Hi All,
    Anyone please help me to fix the problem.
    Actually i am using resource bundle for displaying labels in the jspx, since i developing the page for multilingual that's why i am using bundle in the label attribute.
    When i throw the validation error its displaying like this
    com.sun.faces.el.ValueBindingImpl@106cf24 - Value required.
    How can i fix the code in order display like this
    PO Number - Value required.
    Kindly provide the syntax and changes to be done or sample code.
    Thanks & Regards
    Vimalan Balan

    Hi,
    how do you throw the validation error? Are you adding the message explicitly or what doyou do ? Note that if you reference a binding in your validation then the binding needs to be referenced either by bindings.attr.label or bindings.attr.inputValue.
    Frank

  • Using resource bundler with a specific encoding type

    Hi All,
    Using resource bundler class in Java one can pass the key and get the appropriate string value for that in appropriate language. These strings can be stored in a class (BuldlerList) or in some file.
    My doubt is can I specify the encoding type of the string while passing the key ?
    This might be needed in a case like follows. Say I have a Java Swing application for which I want to get the labels in appropriate language. The application is Windows based. The methods in resource buldler class while getting the string value for a key uses platform's default encoding type. So if I store my file containing all the resource bundler in UTF-8 I can't read them properly from an Windows 2000 system having Japanese as the locale. The constraint is that you can never make Windows default platform encoding as UTF-8 (or something equivalent for Unicode). In that case one cannot developed a truly internationalised application in this frame work.
    Any comments/suggestion/input will be highly appreciated.
    Thanks,
    Sourav

    I dunno 'bout the bundles BUT u can possiblly use XML
    instead.
    u can have a attribute type that specifies the encoding
    type for the content. This will be a totally application
    specific approach BUT it will work.. that much I am sure
    of. IF u read this attribute in your application first and
    then read the value, in that pre-specified encoding, ur
    problem could be solved.
    Just like resource bundles, XML files will be stored in
    local machines only. The only thing is u need a
    JAXP API for processing them.
    aXe!

  • Problem with resource bundle messages written inside script of jsf included

    Hi,
    I have a main jsf page with the name Details.jsp.In this page I included Contacts jsf page.I am using resouce bundle for my application.I written all the output text tags with this resouce bundle keys.And I written the Details main page javascript alerts with this resource bundle correctly.But the problem is,I am having script alrts in my included jsf apge i.e. in Contacts page.When I write the script alerts with the resource bundle keys,it is not displaying properly.
    ---------------------------------------------------------------------Details.jsp--------------------------------------
    <f:loadBundle basename="Details_en" var="msg"/>
    <f:view>
    <head>
    <script>
    function saveFn()
    var d=document.getElementById('dform:dinputtext').value;
    if(d=='')
    alert('<h:outputText value="#{msg.requiredValidationMsgkey}"/>');
    return false;
    if(emailValidation()==false)
    return false;
    </script>
    </head>
    <body>
    <h:form id="dform">
    <h:outputText value="#{msg.nameHeader}"/>
    <h:inputText value="#{Bean.name}" id="dinputtext"/>
    <jsp:include page="/Contacts.jsp"/>
    <h:commandButton value="Save" onclick="if(saveFn()==false) return false;" action="#{Bean.saveAction}"/>
    </h:form>
    </body>
    </f:view>
    -------------------------------------------------Contacts.jsp----------------------------------------
    <script>
    function emailValidation()
    var em= document.getElementById('dform:cSubView:cemailtext').value;
    if(em=='')
    alert('<h:outputText value="#{msg.emailValidationMsgKey}"/>');
    return false;
    </script>
    <f:subview id="cSubView">
    <h:inputText value="#{CBean.email}" id="cemailtext" />
    </f:subview>
    The alert message in SaveFn is getting appeared coorectly.But in the function emailValidation is not geting dispalyed correctly.It is appearing as normat output text in the page,but not as an alert.

    Thanks for the reply.
    But I want to do some validations using javascript not only the required validation.
    In my application 5 text fields and one command button are there .Depending upon combination of 2 or 3 text field values, I have to get the values when I pressed command button.
    If I use the h:messages for validators,the conversion error is occurring when the text field takes wrong data.So it is going to give incorrect results when I press the command button.Thats why I am using javascript.
    When user enters wrong data,I want to do validation using javascript and I want to display the alert message using resource bundle.

  • Best practices for building menus using resource bundles?

    Greetings; I am curious to find out what the current best practices people are using to build menus/menu bars using resource bundles, specifically ListResourceBundle.
    What I am trying to figure out is how best to write my Swing application so it does not need to know what menu items it needs to grab from the resource bundle.
    The only idea I have come up with is this:
    class MyBundle extends ListResourceBundle {
    private Object[][] contents = {
            {"menubar", { {"menu.file.item", "blah"}, ....} }
    }Inside the GUI class:
    Object[][] menubar = resourceBundle.getObject("menubar");I would then iterate over the menu bar items and build the menu. I would have to use a naming scheme and then parse appropriately to know when to start a new menu, when a submenu occurs, etc.
    Is this the common practice, or does anyone know of a more clever way of doing this? I've searched various FAQs and googled about, but I have yet to come across any sort of tutorial or page that covers this.

    Anyone have any input on this? Am I close to the solution people are
    using out in real production environments?

  • I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas

    I have been buying apps for a long time  without a problem using my credit card on file. All of a sudden itunes is not recognizing my card which is in good standing. All the info is correct but itunes/apple says it doesn't  match the bank info. Any ideas?

    Answered in your Other post on this Topic...
    https://discussions.apple.com/message/24053626#24053626

  • How could i use resource bundle in managed bean instead of harding coding?

    component is created in managed bean programmatically, so how to set attributes(e.g. text, value) using resource bundling instead of hard coding, as like coding on the page directlly?
    Thanks for your help!
    Kevin.

    component is created in managed bean programmatically, so how to set attributes(e.g. text, value) using resource bundling instead of hard coding, as like coding on the page directlly?
    Thanks for your help!
    Kevin.

  • Problem refreshing resource bundle from DB table for BC (JDev 11.1.2.1.0)

    In our ADF 11.1.2.1.0 application we are loading bundles form the database, which is not working as expected.
    The problem is that when we want to refresh the bundle, it doesn't work for values on Model (BC) components. Bundles values stay the same.
    Bundle refresh was implemented by this example
    http://technology.amis.nl/2012/08/14/refresh-resource-bundle-from-within-the-adf-application-to-absorb-changes-in-database-backed-bundles/
    We then found that if we put f:loadBundle element on the page, the refresh does execute.
    But only for the ViewController, Model bundles do not refresh.
    On top of every page we have <f:loadBundle basename="si.bron.susa.view.util.ArsoVinBundle" var="res"/>
    On every page we also have a button. Click on it should refresh the bundle by calling the following code:
    public void forceBundleRefresh() {
    try {
    //ResourceBundle.clearCache();
    ResourceBundle.clearCache(Thread.currentThread().getContextClassLoader());
    sLog.info("Resourcebundle.clearCache executed succesfully.");
    } catch (Exception e) {
    sLog.info("Resourcebundle.clearCache cannot be used because jdk version is not 1.6 or higher, try old approach");
    System.out.println("Catch bundlov");
    // try old approach
    for (String resourcebundle : bundleNames) {
    for (String contextDimensionValue : contextDimensionValues) {
    String bundleName = resourcebundle + contextDimensionValue;
    System.out.println("Bundle123: "+ bundleName);
    refreshBundle(bundleName);
    } //for
    Executing this code the bundles of ViewController is always refreshed from DB, but bundles of BusinessComponents are refreshed ONLY FIRST TIME after application is deployed on WebLogic. Next attempts after the first one, don't perform refresh.
    I think it should behave same for BC and VC bundles, isn't it?
    If I am wrong please direct me to some example.
    Regards,
    Sašo Celarc

    In our ADF 11.1.2.1.0 application we are loading bundles form the database, which is not working as expected.
    The problem is that when we want to refresh the bundle, it doesn't work for values on Model (BC) components. Bundles values stay the same.
    Bundle refresh was implemented by this example
    http://technology.amis.nl/2012/08/14/refresh-resource-bundle-from-within-the-adf-application-to-absorb-changes-in-database-backed-bundles/
    We then found that if we put f:loadBundle element on the page, the refresh does execute.
    But only for the ViewController, Model bundles do not refresh.
    On top of every page we have <f:loadBundle basename="si.bron.susa.view.util.ArsoVinBundle" var="res"/>
    On every page we also have a button. Click on it should refresh the bundle by calling the following code:
    public void forceBundleRefresh() {
    try {
    //ResourceBundle.clearCache();
    ResourceBundle.clearCache(Thread.currentThread().getContextClassLoader());
    sLog.info("Resourcebundle.clearCache executed succesfully.");
    } catch (Exception e) {
    sLog.info("Resourcebundle.clearCache cannot be used because jdk version is not 1.6 or higher, try old approach");
    System.out.println("Catch bundlov");
    // try old approach
    for (String resourcebundle : bundleNames) {
    for (String contextDimensionValue : contextDimensionValues) {
    String bundleName = resourcebundle + contextDimensionValue;
    System.out.println("Bundle123: "+ bundleName);
    refreshBundle(bundleName);
    } //for
    Executing this code the bundles of ViewController is always refreshed from DB, but bundles of BusinessComponents are refreshed ONLY FIRST TIME after application is deployed on WebLogic. Next attempts after the first one, don't perform refresh.
    I think it should behave same for BC and VC bundles, isn't it?
    If I am wrong please direct me to some example.
    Regards,
    Sašo Celarc

  • How to use resource bundles?

    I have a requirement to translate the test that appears on the custom buttons of my portal application. I know resource bundles are part of .properties file that are delivered in Classes floder. But i am not sure how should i make use of this in translating the button text. It would be grate if someone knows it. I will be  very helpfull.
    Regards,
    Ameya

    Hi Ameya,
    [This link|http://help.sap.com/saphelp_nw04/helpdata/en/74/641640b7b6dd5fe10000000a155106/frameset.htm] will provide you information on how to implement Portal Content Translation.
    [This link|http://help.sap.com/saphelp_nw04/helpdata/en/62/8b1d40bb37e569e10000000a155106/frameset.htm] will explain how to create and access Resource Bundles (read the entire chapter).
    Hope it helps,
    Roy
    Edited by: Roy Cohen on Nov 26, 2008 3:21 PM

  • 11gR2 Connector not using resource bundle

    Hi All,
    Creating a custom connector based on DBAT.
    I made sure the values in the properties file were changed to match the names I used on the name parameter for the provider definitions. After the install the new provider names seemed to work
    but nothing else. so I ran the download resource script made a few changes and ran the upload resource script and now nothing is working.
    after running the upload the provider names in the drop down when creating the GTC are now the values from the name parameter and not the values in the resource bundle :(
    so how can I test these bundles without do re-installs?
    and how do you create an uninstall for the connector?
    Thanx in advance
    Fred

    TemplateEmailSender will render the JSP using the normal servlet pipeline i.e Thus, the template page is rendered simply as if it were a JSP page requested through a browser. In this case, the locale will be identified from the HTTP-HEADER (in an email case, the locale might be created using the Profile.locale property) and if it is null it will look for /atg/dynamo/servlet/RequestLocale.defaultRequestLocaleName.
    Check the Profile.locale and RequestLocale.defaultRequestLocaleName, you might be getting this issue because of the value is null here.
    Cheers
    R

  • Getting an error while accecing resource bundle from java file......

    I want to access the properties file to my java file ..
    My resource file named as "application" is in the resources package...
    and I am using following code to load the resource file into my java file...
    java.util.ResourceBundle rb = java.util.ResourceBundle.getBundle("resources.application",new Locale("en","US"));
    String message = rb.getString("welcome.heading");
    But getting following error....
    Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name resources.application, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
    at javaapplication1.c.<init>(Main.java:26)
    at javaapplication1.Main.main(Main.java:47)
    Java Result: 1
    can anyone tell me whats the problem and why am i facing this error

    Hi Again,
    Now with a different problem.
    I have removed configuration and imported the configuration again. But now it is not recognizing API ( created by me with all common classes as java project).
    Structre of the application is as follows
    Cedapp -  ear file
    Cedejb   - ejb module
    Cedweb – web module
    Cedapi  - java project with common classes used in both ejb module and  web module and published as library. This refered in both the ejbmodule and web module.
    The problem now I am facing is that cedapi is not getting recognized by ejb module or web module. But it is available in used dcs of each.

  • Indesign problem using content bundler 'internal communication error'

    Hi I have been working on a project using adobe Indesign Cs5 and digital content bundler beta version and have an error message that is preventing the bundling of a publication. "Internal communication error. For more information, see ErrorLog.txt in the application storage directory". On the forums it appears a solution was provided by Bob Levine but I cannot locate the thread where it was written.When I open the error log file it says ERROR UKNOWN PRODUCT
    Any help would be most appreciated as i have been working on this content for quite some time.

    Cheers Bob, I believe you but when I go to download it cuts out. I think there could be a problem with my pre release account. I will give it another go but I think I could be in for a long weekend )-: whats that saying, when it rains it pours. I will get this drop 11 even it kills me! Have a great day in the big apple.
    Kind regards,
    Andrew

  • Problem Using wlserver task in ant file

    I am trying to create a weblogic domain using the following in my ant file:
    <target name="new-server">
    <mkdir dir="/opt/deployment/domains" />
    <wlserver dir="/opt/deployment/domains"
    beahome="/opt/bea"
    domainname="SandboxDomain"
    servername="AdminServer"
    host="localhost" port="7001"
    generateConfig="true"
    username="weblogic" password="password"
    productionmodeenabled="false"
    action="start" failonerror="true" />
    </target>
    However, I keep getting the following exception:
    [wlserver] Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server
    I am executing the ant script by placing the weblogic.jar file in the lib directory of ant. I am also using ant version 1.6.2. Any suggestions on how to remedy this problem would be appreciated.

    Hi,
    Had the same problem, try adding the classpath attribute to the wlserver tasks.
    example:
    <wlserver dir="${SERVER_DOMAINS}/test_domain"
    beahome="${SERVER_ROOT}"
    weblogichome="${SERVER_WEBLOGIC_HOME}"
    generateConfig="true"
    host="localhost"
    port="6001"
    username="${WEBLOGIC_USER}"
    password="${WEBLOGIC_PASSWORD}"
    servername="testServer"
    action="start"
    classpath="<wl_installdir>\server\lib\weblogic.jar">
    Regards,

  • Problem using af:inputfile when only file name is given without path.URGENT

    Hai Friends,
    I am using input file type and <h:commandLink to upload a file. But when I type only the file name without the path like(hello.jpg) and try to submit then a javascript error occured "Access is denied". But my requirement is when i type without the path, that is only the file name i need to do some validations, like appending a global path with this file name and upload the file... the following is the code am having...
    <af:form id="address" usesUpload="true" >
    <af:inputFile id="id" value="#{BKb.batchFile}"/>
    <h:commandLink action="#{.uploadFile}">
    <h:outputText value="Upload" styleClass="buttonNoDecoration"/>
    </h:commandLink>
    <h:commandLink action="#{BKb.clearFile}">
    </h:commandLink>
    </af:form>
    can u help me in this issue...
    Thanks in advance,
    Ciya

    I figured out the problem, and it was caused by JHeadstart. I placed a default display value in JHeadstart for the download link. This caused a default values bean to be created by jheadstart and that bean was what was causing my problem. The download link had a display value, but not a valid path. I removed the default value, re-generated the screen and it is totally fixed. I have pretty much decided that it is never a good idea to use a default value in Jheadstart.
    Thanks for your help,
    Michelle

Maybe you are looking for

  • Screen saver won't stay on photo library

    Boy, lots of unanswered questions with the new OS 10.10.  I posted this question yesterday, got no responses, and now it is so far back I didn't get to it after adding More Pages over ten times - still at 4 hours ago.  I don't think anyone will ever

  • How do I stream iTunes to my AppleTV??

    I must be missing something. I have synced content on my ATV but I also have content on my iTunes library that isn't synced and want to stream. How do I do this?? Pardon my ignorance........thanks!

  • Release date for next version of Forms?

    Has anyone heard of a release date for the next version of Forms (10.1.2.0.2 or whatever it will be)? I may be starting a major Forms project shortly and I'd like to use the most current version of Forms with the current Application Server.

  • Reg: REport Painter Urgent

    HI all, I want to modify the report using grr2 but in libray particular report not showing. from easy access report is working/ how can see that report in library. regards JK rao

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception