0 Replies Latest reply on Apr 24, 2009 11:30 AM by hattifnat

    Internationalization template with EL in template parameters

    hattifnat

      Hi! I have a following problem: there is an exception class ParseException with some parameters (position, message). I'd like to display an internationalized Faces Message showing the exception's parameters in a nice way. But the exception message should allow internationalization, too. So I thought of having in messages_xx.properties a template like error.packet.display.filter.syntax=Syntax error [#0]: #1. Then, I'd invoke


      facesMessages.addToControlFromResourceBundle(
          "filterText",
          Severity.ERROR,
          "error.packet.display.filter.syntax",
          e.getErrorOffset(),
          e.getLocalizedMessage());



      where e.getLocalizedMessage() would return some EL, like #{messages['filter.parser.error.format']}. Unfortunately, this does not work, because the template parameters are inserted literally and the displayed result is:
      Syntax error [0]: #{messages['filter.parser.error.format']}. Is there a way to have the EL resolved? Or another way to nicely display the message?