ICEfaces
  1. ICEfaces
  2. ICE-1681

com.icesoft.jasper.compiler.Localizer doesn't really localize, in that it is not using resource bundle to localize messages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6DR#5
    • Fix Version/s: 1.7DR#1, 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      N/A

      Description

      Here's how I ran into this problem...

      Liferay has a tag library JAR named util-taglib.jar that gets added to every hot-deployed WAR, whether it needs it or not.

      Well anyway, inside util-taglib.jar there is a file named:
          META-INF/liferay-portlet-ext.tld

      Which has the following DTD specified:
      <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

      Now I realize this is an ancient tag library DTD, and we need to update that, however, when the ICEfaces TlDLocationsCache was trying to extract the TLD file and parse it with an XML parser, it couldn't find the ancient web-jsptaglibrary_1_1.dtd file in the com/icesoft/jasper/ ClassPath. (The only one there is web-jsptaglibrary_1_2.dtd).

      Like I said, the XML parser couldn't validate the tag library against this ancient DTD, and so the com.icesoft.jasper.xmlparser.CachedEntityResolver class threw this exception:

                          throw new SAXException(
                                  Localizer.getMessage(
                                          "jsp.error.internal.filenotfound",
                                          resourcePath));

      Now, the Localizer class is supposed to load up a message bundle (according to the locale of the user I guess), and substitute the resourcePath (/com/icesoft/jasper/web-jsptaglibrary_1_1.dtd) into the message.

      Well, the whole resourceBundle stuff is totally commented out of the Localizer class, and therefore, it never gets substituted.

      Recommend that ICEsoft implement/re-implement the resourceBundle method, or otherwise, simply concatenate all of the parameters to the message, rather than ignore them. Right now the "Localizer" class doesn't localize at all.

        Activity

        Hide
        Ted Goddard added a comment -

        A change to the localizer has been checked in to improve the error message. Note that these errors do not occur under typical circumstances (unlike other errors ...) so the message output code has not undergone extensive testing.

        Show
        Ted Goddard added a comment - A change to the localizer has been checked in to improve the error message. Note that these errors do not occur under typical circumstances (unlike other errors ...) so the message output code has not undergone extensive testing.
        Hide
        Neil Griffin added a comment -

        Until the resourcebundle thing is implemented, I recommend the following quick fix change:

        In CachedEntityResolver.java at line 37, change:

        throw new SAXException(
        Localizer.getMessage(
        "jsp.error.internal.filenotfound",
        resourcePath));

        To this:

        throw new SAXException("jsp.error.internal.filenotfound: " + resourcePath);

        Show
        Neil Griffin added a comment - Until the resourcebundle thing is implemented, I recommend the following quick fix change: In CachedEntityResolver.java at line 37, change: throw new SAXException( Localizer.getMessage( "jsp.error.internal.filenotfound", resourcePath)); To this: throw new SAXException("jsp.error.internal.filenotfound: " + resourcePath);

          People

          • Assignee:
            Unassigned
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: