Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 在单独的jar中部署具有复合组件的支持bean_Jsf_Jsf 2_Web Deployment_Composite Component_Backing Beans - Fatal编程技术网

Jsf 在单独的jar中部署具有复合组件的支持bean

Jsf 在单独的jar中部署具有复合组件的支持bean,jsf,jsf-2,web-deployment,composite-component,backing-beans,Jsf,Jsf 2,Web Deployment,Composite Component,Backing Beans,我在JBoss AS 6.1上部署web应用时遇到一些困难。我当前的项目分为主web应用程序(controller/ManagedBeans和使用JSF2Facelets的web前端)和一个包含复合组件+支持bean的jar。但是当我尝试访问页面时,我得到一个错误,指定的组件类型无法实例化 将支持bean复制到主web应用程序中可以解决问题,但这不是我想要的。有什么需要注意的吗 背豆看起来像 @FacesComponent(value = "elementBase") public class

我在JBoss AS 6.1上部署web应用时遇到一些困难。我当前的项目分为主web应用程序(controller/ManagedBeans和使用JSF2Facelets的web前端)和一个包含复合组件+支持bean的jar。但是当我尝试访问页面时,我得到一个错误,指定的组件类型无法实例化

将支持bean复制到主web应用程序中可以解决问题,但这不是我想要的。有什么需要注意的吗

背豆看起来像

@FacesComponent(value = "elementBase")
public class ElementBase extends UINamingContainer {
    ...
}
以及复合组件接口

<composite:interface componentType="elementBase">
... some attributes
</composite:interface>
<composite:interface componentType="elementBase">
    ... some attributes, value holder, ..
</composite:interface>

我还尝试在
META-INF
文件夹中添加
faces config.xml
,使用组件类型,但仍然找不到组件类型。

通过BalusC对问题的回答

至于托管bean和其他JSF类,如验证器、转换器等,只需使用
@ManagedBean
@FacesValidator
@facescoverter
等对它们进行注释,然后以通常的方式将它们打包到JAR中。您只需要在JAR中提供一个与JSF2.0兼容的
/META-INF/faces config.xml
文件

  • 和具有以下接口的复合组件

    <composite:interface componentType="elementBase">
    ... some attributes
    </composite:interface>
    
    <composite:interface componentType="elementBase">
        ... some attributes, value holder, ..
    </composite:interface>
    
  • 在WEB应用程序的
    /WEB-INF/lib
    文件夹中部署jar

  • 研究/相关链接和主题

    通过BalusC对问题的回答

    至于托管bean和其他JSF类,如验证器、转换器等,只需使用
    @ManagedBean
    @FacesValidator
    @facescoverter
    等对它们进行注释,然后以通常的方式将它们打包到JAR中。您只需要在JAR中提供一个与JSF2.0兼容的
    /META-INF/faces config.xml
    文件

  • 和具有以下接口的复合组件

    <composite:interface componentType="elementBase">
    ... some attributes
    </composite:interface>
    
    <composite:interface componentType="elementBase">
        ... some attributes, value holder, ..
    </composite:interface>
    
  • 在WEB应用程序的
    /WEB-INF/lib
    文件夹中部署jar

  • 研究/相关链接和主题