Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3347

Improve web config param logging and enhance @JSFWebConfigParam

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.10, 2.1.4
    • JSR-314
    • None

    Description

      Right now, some params are logged when myfaces is started or shutdown. Such log is done on MyfacesConfig class. It has the following problems:

      • Logging about application startup should be done on AbstractFacesInitializer.
      • That log should only be done on Production and Development project stage. For UnitTest and SystemTest, it should be silently ignored.
      • A web config param should be used to enable/disable.
      • All web config params not configured should be logged, not only the ones defined on MyfacesConfig.
      • Deprecated params should not be logged.
      • Params with expected values should be checked, and if it fails, log a warning message.

      To solve all that problems, the idea is add the following fields to @JSFWebConfigParam:

      /**

      • The group which the param belongs.
      • <p>These are the groups used in myfaces core:</p>
      • <ul>
      • <li>state</li>
      • <li>resources</li>
      • <li>viewhandler</li>
      • <li>validation</li>
      • <li>render</li>
      • <li>EL</li>
      • </ul>
      • @return
        */
        String group() default "";

      /**

      • The tag(s) or clasification(s), separated by commas
      • that this web config param can be clasified.
      • <p>These are the tags used in myfaces core:</p>
      • <ul>
      • <li>tomahawk</li>
      • <li>performance</li>
      • </ul>
      • @return
        */
        String tags() default "";

      /**

      • Indicate if the param was deprecated or not.
      • @return
        */
        boolean deprecated() default false;

      /**

      • Indicate an alias or alternate name for this param.
      • @return
        */
        String alias() default "";

      /**

      • Indicate if this param ignore upper or lower case when read params
      • @return
        */
        boolean ignoreUpperLowerCase() default false;

      /**

      • The java type or class which this param is converted
      • @return
        */
        String classType() default "";

      And create a class that generate this automatically using myfaces builder plugin make-config goal. In that way, each time we add a @JSFWebConfigParam annotation, the code will be synchronized automatically. Definitively this strategy is easier than create a class that hold all web config params, because it is more "flexible" and simple. Just create a constant, and the annotation and that's it.

      Attachments

        1. MYFACES-3347-mbp.patch
          9 kB
          Leonardo Uribe
        2. MYFACES-3347-core.patch
          63 kB
          Leonardo Uribe

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: