setting org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT to false leads to exception
--------------------------------------------------------------------------------

                 Key: TRINIDAD-1894
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1894
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 2.0.0.3-core
         Environment: Java 6, Apache Tomcat 6/WebLogic 11
            Reporter: Christoph Kainrath
            Priority: Minor


<context-param> 
    <param-name>org.apache.myfaces.trinidad.DEBUG_JAVASCRIPT</param-name>
    <param-value>false</param-value>
  </context-param>

in web.xml leads to:

java.lang.NullPointerException
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LibraryScriptlet._isDebug(LibraryScriptlet.java:223)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LibraryScriptlet.getLibraryName(LibraryScriptlet.java:126)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LibraryScriptlet.getLibraryURL(LibraryScriptlet.java:145)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.LibraryScriptlet.outputScriptletImpl(LibraryScriptlet.java:98)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.outputScriptlet(Scriptlet.java:62)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils.addLib(XhtmlUtils.java:141)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.outputDependency(Scriptlet.java:154)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.AliasedScriptlet.outputScriptletImpl(AliasedScriptlet.java:127)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.jsLibs.Scriptlet.outputScriptlet(Scriptlet.java:62)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.XhtmlUtils.addLib(XhtmlUtils.java:141)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:108)
        at 
org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:81)
        at 
org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:488)

If I remove the context-param element from my web.xml it works fine!

static private boolean _isDebug(FacesContext context)
  {
    if (_debugJavascript == null) {
      String debugJavascript = context.
          getExternalContext().getInitParameter(_DEBUG_JAVASCRIPT);

      if (debugJavascript != null) {
        if (debugJavascript.equalsIgnoreCase("true")) {
          _debugJavascript = Boolean.TRUE;
        
          // if Apache MyFaces Trinidad is running in production stage
          // running with JavaScript debugging is not desired, therefore
          // we generate a WARNING message; otherwise we just inform the user
          if (context.isProjectStage(ProjectStage.Production))
          {
            _LOG.warning("RUNNING_DEBUG_JAVASCRIPT_IN_PRODUCTION_STAGE");
          }
          else
          {
            _LOG.info("RUNNING_DEBUG_JAVASCRIPT"); 
          }
        }
      } else {
        // if the _DEBUG_JAVASCRIPT parameter has NOT been specified, let us
        // apply the DEFAULT values for the certain Project Stages:
        // -PRODUCTION we want this value to be FALSE;
        // -other stages we use TRUE
        _debugJavascript = !(context.isProjectStage(ProjectStage.Production));
        if (_debugJavascript)
        {
          _LOG.info("RUNNING_DEBUG_JAVASCRIPT"); 
        }
      }
    }

    return _debugJavascript.booleanValue();
  }

--> _debugJavascript is only initialized if 
(debugJavascript.equalsIgnoreCase("true")). Please insert something like "else 
_debugJavascript = Boolean.FALSE;"

Thanks

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to