共享库上的@FacesComponent [英] @FacesComponent on shared library

查看:124
本文介绍了共享库上的@FacesComponent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Websphere 8.5上使用自定义jsf组件。
组件类使用@FacesComponent注释。

I'm trying to use a custom jsf component on Websphere 8.5. The component class is annotated with @FacesComponent.

组件位于服务器上的共享库jar中。我已经在jar META-INF文件夹中有一个faces-config。

The component is on a shared lib jar on the server. I already have an faces-config inside the jar META-INF folder.

如果jar在我的ear文件中,它按预期工作,但是当它的
时在sharedlib上它给了我未定义的组件类型MyUIActionList错误。

If the jar is inside my ear file it works as expected, but when its on a sharedlib it gives me "Undefined component type MyUIActionList" error.

关于如何使这个工作的任何想法?

Any ideas on how to make this work?

推荐答案

Web片段JAR属于 WAR / WEB-INF / lib 绝对不是 EAR / lib 也不是 Server / lib

Web fragment JARs belong in WAR/WEB-INF/lib and absolutely not in EAR/lib nor Server/lib.

另见a.o. Servlet 3.0规范的第8.1章(强调我的) :

See also a.o. chapter 8.1 of Servlet 3.0 specification (emphasis mine):


8.1注释和可插入性



在Web应用程序中,使用注释的类如果它们位于 WEB-INF / classes 目录中,或者它们打包为$ b,则会将其注释处理为
应用程序中位于 WEB-INF / lib 的jar文件中的$ b。

8.1 Annotations and pluggability

In a web application, classes using annotations will have their annotations processed only if they are located in the WEB-INF/classes directory, or if they are packaged in a jar file located in WEB-INF/lib within the application.

...

故事结束。

这篇关于共享库上的@FacesComponent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆