Using numbers as resource bundle message references

I searched (hopefully using the right keywords) but didn't find anything regarding this...how do you use numeric resources in your resource bundle?
I'm just trying to reuse the message bundle from a different app...the bundle uses all numbers.
2260=My message
This tag is in my page...
<h:outputText value="#{message.2260}"/>
But I receive the error below...
Am I missing something? Is there a workaround for this if it is a shortcoming?
Thanks....
2004-10-13 09:29:22,093 DEBUG [com.sun.faces.taglib.html_basic.OutputTextTag] - <id: null class: com.sun.faces.taglib.html_basic.OutputTextTag>
javax.faces.el.ReferenceSyntaxException: Encountered ".2260" at line 1, column 10.
Was expecting one of:
    ">" ...
    "gt" ...
    "<" ...
    "lt" ...
    "==" ...
    "eq" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "!=" ...
    "ne" ...
    "+" ...
    "div" ...
    "mod" ...
    "and" ...
    "or" ...
    "||" ...
        at com.sun.faces.application.ApplicationImpl.checkSyntax(ApplicationImpl.java:912)
        at com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:399)
        at com.sun.faces.util.Util.getValueBinding(Util.java:943)
        at com.sun.faces.taglib.html_basic.OutputTextTag.setProperties(OutputTextTag.java:101)
        at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1026)
        at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1045)
        at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:732)
        at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:425)
        at com.sun.faces.taglib.html_basic.OutputTextTag.doStartTag(OutputTextTag.java:149)
        at org.apache.jsp.changeHomeSite_jsp._jspx_meth_h_outputText_16(changeHomeSite_jsp.java:1374)
        at org.apache.jsp.changeHomeSite_jsp._jspx_meth_h_form_0(changeHomeSite_jsp.java:1091)
        at org.apache.jsp.changeHomeSite_jsp._jspx_meth_f_view_0(changeHomeSite_jsp.java:142)
        at org.apache.jsp.changeHomeSite_jsp._jspService(changeHomeSite_jsp.java:93)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
        at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
        at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
        at java.lang.Thread.run(Thread.java:534)
Caused by: com.sun.faces.el.impl.parser.ParseException: Encountered ".2260" at line 1, column 10.
Was expecting one of:
    ">" ...
    "gt" ...
    "<" ...
    "lt" ...
    "==" ...
    "eq" ...
    "<=" ...
    "le" ...
    ">=" ...
    "ge" ...
    "!=" ...
    "ne" ...
    "+" ...
    "div" ...
    "mod" ...
    "and" ...
    "or" ...
    "||" ...
        at com.sun.faces.el.impl.parser.ELParserImpl.generateParseException(ELParserImpl.java:2229)
        at com.sun.faces.el.impl.parser.ELParserImpl.jj_consume_token(ELParserImpl.java:2097)
        at com.sun.faces.el.impl.parser.ELParserImpl.AttrValueExpression(ELParserImpl.java:105)
        at com.sun.faces.el.impl.parser.ELParserImpl.ExpressionString(ELParserImpl.java:45)
        at com.sun.faces.el.impl.ExpressionEvaluatorImpl.parseExpressionString(ExpressionEvaluatorImpl.java:277)
        at com.sun.faces.el.impl.ExpressionEvaluatorImpl.parseExpression(ExpressionEvaluatorImpl.java:194)
        at com.sun.faces.application.ApplicationImpl.checkSyntax(ApplicationImpl.java:904)
        ... 54 more

That's it, thanks. (Sub 10 minute response? Supercool--does that merit dukies? (new to posting to the forums))

Similar Messages

  • 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?

  • How to load the resource bundle message on confirmation popup

    hi every one
    i am using java script confirmation message on my delete button.
    this is my sample for that one
    <h:commandButton action="#{createCurrency.removeCurrency}"
             onclick="if (!confirm('Are you sure to delete this value?')) return false" value="#{messages.Delete}"/>    i need to load the "Are you sure to delete this value?" from resource bundle.
    is there any way to load above message from resource bundle.
    thiagu.m

    If you're using JSF 1.2, you can add the bundle config in your faces-config.xml file like this:
    <resource-bundle>
       <base-name>mypackage.i18n.MessageResources</base-name> // i18n is shorthand for internationalization
       <var>msg</var>
    </resource-bundle>     
    <locale-config>           
       <default-locale>en</default-locale>  // or whatever locale you preferred 
       <supported-locale>...</supported-locale> // other locale defined here if you need them
    </locale-config>Then create a property file called "MessageResources_en.properties. In this file, you can define something like:
    {code}
    MSG_CONFIRM=Do you wish to delete this value?
    // add other messages here. Syntax is: key=value
    {code}
    Then reference the bundle's message in your form as per normal:
    {code}
    !confirm(#{msg.MSG_CONFIRM}))
    {code}
    I haven't tried the above codes but it should help you get started.
    Edited by: icepax on 13/11/2009 19:44

  • 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.

  • How to use xliff as resource bundle ?

    I used to do Java i18n as following base on resource bundle in properties file format:
    Locale myLocale = new Locale("es", "ES");
    ResourceBundle bundle = ResourceBundle.getBundle("HelloResourceBundle", myLocale);
    System.out.println(bundle.getString("Hello"));I realized that there is new bundle called xliff like:
    <trans-unit id="Hello">
    <source>Hello how are you</source>
    <note>This is message to say hello</note>
    </trans-unit>Does java resource bundle support xliff file similar to properties file? if not, could anybody give an example how to handle xliff file?
    Thanks

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • Using "{" character in resource bundle.

    Hello,
    I was to use a "{", "}" characters in resource bundle. The problem is that, when I get the resource value, I use the method: MessageUtils.substituteParams in order to replace parameters like {0}, {1}, ...
    Is there a way of escaping the "{", "}" characters with subtitureParams method ? I tried "\{" and it still didn't work.

    Please see the java-api docs for your answer:
    http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
    Using "\u2019" only works because it is an alternative quote character, but it is not the same as the standard ascii single quote (')
    If you want to include a ' in your format string, then put two next to each other like '' (like Pascal if anyone remembers that ...)
    If you want to quote anything else, then use single quotes to surround the quoted text eg. "The message is '{not a param string}'"

  • 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.

  • When I try to use Numbers, I get a message that I need to upgrade.  According the the app page, I am up to date.  Why?

    Why do I get a message to upgrade when according to the app store I am up to date?

    Hi Laura,
    Perhaps you have both Numbers '09 and Numbers 3.x on your machine. Automatic updates from App Store will do that.
    Wayne Contello has written a User Tip for working with the old and new versions of iWork.
    Need newer version of Numbers to open file
    Regards,
    Ian.

  • How to use XLIFF file as resource bundle in Java code

    We use xliff as resource bundle for our ADF application. it is has been no problem to have localized message displayed on UI. how ever, I'm wonderring how to use Java code to access xliff as resource bundle which similar to access properties resource bundle. for example:
    Locale myLocale = new Locale("es", "ES");
    ResourceBundle bundle = ResourceBundle.getBundle("HelloResourceBundle", myLocale);
    System.out.println(bundle.getString("Hello"));is it posible to create "HelloResourceBundle" in xliff format?
    Thanks

    Following code worked for me:
    import oracle.javatools.resourcebundle.BundleFactory;
    import java.util.ResourceBundle;
    * This method retrieves localized strings from a given XLIF resource bundle.
    * @param bundleName The XLIF bundle from which the localized string is to be retrieved.
    * @param key The key of the localized string.
    * @return The localized string retrieved from the given XLIF bundle.
    public static String getXlifLocalizedString(String bundleName, String key) {
    if (StringUtils.isEmpty(key)) {
    return key;
    if (StringUtils.isEmpty(bundleName)) {
    return "[" + key + "]";
    String localizedString = null;
    ResourceBundle resourceBundle = null;
    try {
    resourceBundle = BundleFactory.getBundle(bundleName);
    localizedString = resourceBundle.getString(key);
    } catch (Exception e) {
    LOG.log(Level.SEVERE, "Problem in loading XLIF resource bundle: " + bundleName, e);
    return "[" + key + "]";
    return localizedString;
    }

  • How to use common resource bundle across all the development components ?

    Hi,
    I am working on SAP NetWeaver Developer Studio - JAVA
    How to use common resource bundle across all the development components ?
    Description :
    I have a requirement of creating a resource bundle (resource.properties) and use that common resource bundle in all the development components.
    Can we create a  development component (war and ear both) and create only resource.properties in this development component( DC ) and create the dependency of the same DC  in all the other DCs ?
    Thanks,
    Neha

    Hello Neha 
    This question is more NWDS related.
    You may have a better chance of someone answering the thread under
    SAP Netweaver -> SAP NetWeaver Development Infrastructure (NWDI, formerly known as JDI) forum
    Thanks
    Kenny

  • Resource bundles, loading in beans or in jsp or share them?

    Hi,
    I have a question and hope it is not a stupid one.
    What is the best way to work with resource bundles/messages developing faces application?
    One way is to load and use it in jsp. It is convenient and easy. Another is to use it within a bean. It's a little bit more complicated and might take more memory. Taking into account that sometimes general messages are to be used in both is there a guideline or some usual practice on how do I can access a resourcebundle that been loaded in jsp from bean?
    Suppose I have couple beans that might use the same messages - logically it is better to load bundle in jsp and use it from beans.
    Of course it could be loaded via faces config file, but some messages are needed only by couple of pages (registration for example).
    Please let me know your thoughts or how it is done usually.
    Thanks in advance!!

    You can use as many f:loadBundle tags in the JSP page as you want. You can also use them simultaneously with any <message-bundle> and/or <resource-bundle> declaration in the faces-config.xml. Just choose the one which covers the scope of the bundle in question.

  • Unable to refer to custom resource bundle in WPC content rendered with xslt

    Hi,
    I need to use the resource bundle messages inside WPC content.
    When rendered by standard xsl templates the  call to XSLTHelper class is done to retrieve message from the standard SAP resource bundle com.sap.nw.wpc.bundles.core.properties, like this:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                         xmlns:wpc="com.sap.nw.wpc.km.service.editor.hslt.XsltHelperCore">
    <xsl:value-of select="wpc:getString([key defined in sap bundle], string(/document/@locale))"/>
    The problem is that helper class doesn't provide any API to use custom bundles.
    I tried to create xslt helper (including config in KM), but that didn't succeed neither. It would return with error NoClassDefFound.
    Could you please help on configuring xslt helper and registering it with xslt rendering engine for Web Page Composer? I could not find any how-to guides on xslt helpers for WPC.
    Thanks in advance.
    Ruslan

    Hi
    Did you find a solution?
    Christof

  • Resource bundle in shared library?

    Is it possible to create a resource bundle in a shared library so you can use the same resource bundle in different application?
    We are creating different ADF application and each of them should use the same resource bundle.
    I tried creating a new project that only contains the resource bundle and then add this to my jspx page:
    <c:set var="res"
             value="#{adfBundle['general.resources.generalBundle]}"/>When i do this, he can't find any entries. When i change the project properties and configure to use a single bundle for the entire project, this works.
    How can i share a bundle so each application does not need to create or copy/paste the bundle?
    Is it possible to deploy the bundle as a shared library? Even if their is nothing else, not even a single java class?
    Edited by: Yannick.O on Jul 28, 2010 10:45 AM

    Try to create a JAR with the resource file in it (under /META-INF) and add it as a library in your project.
    If it does not work, try to create a faces-config.xml file inside that directory that declares the resource file.
    I think it gets merged at runtime with the config of your application and resource bundle should be available.

  • Flex SDK 4.5 error in compiled resource bundle

    I have just started using Flex SDK 4.5 (I was using 4.1 before).
    I am compiling my resource bundles into SWF files and using them. I am including the required framework bundles also when compiling my resources into SWF.I have copied the generated SWF file to the deployment folder. When I start the application, I am getting the following error even though this bundle is included in my generated SWF file.
    Error: Could not find compiled resource bundle 'core' for locale 'en'.
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()[E:\ dev\hero_private_beta\frameworks\projects\framework\src\mx\resources\R esourceManagerImpl.as:367]
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[E: \dev\hero_private_beta\frameworks\projects\framework\src\mx\resources\ ResourceManagerImpl.as:287]
        at mx.core::FlexModuleFactory/installCompiledResourceBundles()[E:\dev\he ro_private_beta\frameworks\projects\framework\src\mx\core\FlexModuleFa ctory.as:631]
        at mx.core::FlexModuleFactory/docFrameHandler()[E:\dev\hero_private_beta \frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:601]
        at mx.core::FlexModuleFactory/docFrameListener()[E:\dev\hero_private_bet a\frameworks\projects\framework\src\mx\core\FlexModuleFactory.as:129]
    following is the command that I use to compile resource bundles into SWF file:
    C:\"Program Files (x86)"\Adobe\"Adobe Flash Builder Burrito"\sdks\4.5.0\bin\mxmlc -locale=en -source-path=locale/{locale} -include-resource-bundles=core,effects,skins,styles,components,layout ,MyAppResources -output MyAppResources_en.swf

    Any ideas on this will be much appreciated. I have to step back from 4.5 to 4.1 if I do not get past this error. Thanks.

  • Resource Bundle being overwritten

    Hello,
    We are upgrading from jhs 9.03 to jhs 9.0.4.4. A new feature is resource bundles and that is were we are having problems with.
    We have two jhs subapplications and I want to use the same resource bundle class for both applications. The problem is that every time I start JAG the class is being overwritten and not append to the existing class.
    There is a other project that also uses jhs and has two subapplications. They don't have that problem. There the class is not overwritten every time.
    I first tried using JDeveloper 9.0.3.1, but also tried it with JDeveloper 9.0.3.3. Both had this problem.
    Does anyone have a idea what this could be? When does JAG decide that the file should be overwritten?
    Thanx,
    Dennis

    Dennis,
    The JAG loads the existing COMPILED resource bundle. So, make sure you compile your resource bundle before you run the JAG, and make sure it is on the classpath of your project.
    Lastly, make sure you set "Override NLS Resource Bundle Entries" to false in the Application Structure Editor.
    Steven Davelaar,
    JHeadstart Team.

Maybe you are looking for