Portlet-Bridge、Richfaces 和 ajax4jsf 如何协同工作?

发布于 2024-09-25 13:46:30 字数 2923 浏览 5 评论 0 原文

我正在尝试使用 JBoss 论坛portlet 桥文档。我的目标是在实现 protlet 时使用 JSF 2.0。

我使用 maven 在 Liferay 中构建和部署 portlet,并包含 Richfaces 依赖项,如下所示:

<dependency>
  <groupId>javax.faces</groupId>
  <artifactId>jsf-impl</artifactId>
  <version>2.0.2-FCS</version>
</dependency>
<dependency>
  <groupId>org.jboss.portletbridge</groupId>
  <artifactId>portletbridge-api</artifactId>
  <version>2.0.0.CR1</version>
</dependency>
<dependency>
  <groupId>org.jboss.portletbridge</groupId>
  <artifactId>portletbridge-impl</artifactId>
  <version>2.0.0.CR1</version>
</dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces-bom</artifactId>
            <version>4.0.0.20100826-M2</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
<dependency>
  <groupId>com.sun.facelets</groupId>
  <artifactId>jsf-facelets</artifactId>
  <version>1.1.15.B1</version>
</dependency>

但是当我使用此配置时,出现以下错误:

 SEVERE: Exception starting filter ajax4jsf
 java.lang.ClassNotFoundException: org.ajax4jsf.Filter
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
  at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
  at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
[...]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

所以我再次查看论坛并发现 这篇文章,我认为ajax4jsf不再需要在web.xml和portlet.xml中进行任何配置。所以我把它扔掉并得到以下错误:

[TomcatInstrumentableClassLoader@1738d88] error can't determine annotations of missing type org.ajax4jsf.renderkit.AjaxViewRootRenderer

现在我很困惑:我必须在web.xml中配置ajax4jsf吗?为什么 Liferay 没有发现它?这个模块有什么用处,JSF 2.0 实现还是 richfaces 专有功能?

I am trying to get Liferay 6.0, JBoss portlet bridge 2.0 and Richfaces 4.0.0 working together by using the configuration as stated in JBoss Forum and the portlet bridge documentation. My goal is to use JSF 2.0 when implementing protlets.

I use maven for building and deploying the portlet in Liferay and included the Richfaces dependancy like this:

<dependency>
  <groupId>javax.faces</groupId>
  <artifactId>jsf-impl</artifactId>
  <version>2.0.2-FCS</version>
</dependency>
<dependency>
  <groupId>org.jboss.portletbridge</groupId>
  <artifactId>portletbridge-api</artifactId>
  <version>2.0.0.CR1</version>
</dependency>
<dependency>
  <groupId>org.jboss.portletbridge</groupId>
  <artifactId>portletbridge-impl</artifactId>
  <version>2.0.0.CR1</version>
</dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces-bom</artifactId>
            <version>4.0.0.20100826-M2</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
<dependency>
  <groupId>com.sun.facelets</groupId>
  <artifactId>jsf-facelets</artifactId>
  <version>1.1.15.B1</version>
</dependency>

But when I use this configuration I get the following error:

 SEVERE: Exception starting filter ajax4jsf
 java.lang.ClassNotFoundException: org.ajax4jsf.Filter
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
  at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
  at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
  at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
[...]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

So I looked again at the forum and found this post, which says in my opinion that ajax4jsf does not need any configuration in web.xml and portlet.xml anymore. So I threw it out and got the following error:

[TomcatInstrumentableClassLoader@1738d88] error can't determine annotations of missing type org.ajax4jsf.renderkit.AjaxViewRootRenderer

Now I am confused: Do I have to configure ajax4jsf in web.xml? Why isn't it found by Liferay? And what is this module good for anyway, JSF 2.0 implementation or richfaces proprietary functionality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

魔法唧唧 2024-10-02 13:46:30

支持 JSF 2 的唯一 JBoss Portlet Bridge 版本为 alpha
此处。您可以使用 2.0.0.FINAL api jar 将 jar 放入 lib 文件夹中。另外,svn 中有基于 Maven 的示例,它们具有 Liferay 配置文件“mvn package -Pliferay”。

The only version of JBoss Portlet Bridge that supports JSF 2 is in alpha
here. You can drop the jar in your lib folder with the 2.0.0.FINAL api jar. Also, there are maven based examples in svn that have a Liferay profile "mvn package -Pliferay".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文