2015-12-14 24 views
1

我试图用MyFaces 2.2.8设置一个简单的JSF 2.2应用程序。 由于MyFaces有一些我以前从未使用的上下文参数,我试图熟悉这些参数。submitForm()未为myfaces定义.JSF_JS_MODE'minimal-modern'

所以我第一次使用org.apache.myfaces.JSF_JS_MODE,并遇到h:commandLink的问题。 如果我将模式设置为minimal-modern,commandLink正尝试呼叫myfaces.oam.submitForm(),这是未定义的。 如果我将模式设置为minimalnormal它可以工作。

从阅读一些互联网文章,我认为这是一个错误,因为submitForm既不是jsf-legacy.js的一部分,也不是jsf-i18n.js,也不是jsf-experimental.js,它显然需要h:commandLink。 同样的org.apache.myfaces.shared.renderkit.html.util.ResourceUtils.markScriptAsRendered(FacesContext, String, String)源代码注释告诉我

oamSubmit脚本包含内部jsf.js

这里:

public static void markScriptAsRendered(FacesContext facesContext, String libraryName, String resourceName) 
{ 
    getRenderedScriptResources(facesContext).put(
      libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE); 
    if (JAVAX_FACES_LIBRARY_NAME.equals(libraryName) && 
     JSF_JS_RESOURCE_NAME.equals(resourceName)) 
    { 
     // If we are calling this method, it is expected myfaces core is being used as runtime and note 
     // oamSubmit script is included inside jsf.js, so mark this one too. 
     getRenderedScriptResources(facesContext).put(
       MYFACES_LIBRARY_NAME+'/'+MYFACES_JS_RESOURCE_NAME, Boolean.TRUE); 
    } 
} 

缺少什么我在这里?提前致谢!

回答

1

我可以确认它是一个错误。解决在MYFACES-4034为2.2.10

+0

非常酷。感谢您打开并修复它! – tobwoerk