是否有关于如何使用JSF设置Groovy的文档?我安装了最新版本的groovy eclipse插件,启用了groovy性质,并开始编码。
我将以下内容添加到我的web.xml中(根据jsf开发人员的博客here发布。
<filter>
<filter-name>GroovyFilter</filter-name>
<filter-class>com.sun.faces.scripting.GroovySupportFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>GroovyFilter</filter-name>
<url-pattern>/\*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
然后去创建托管bean:
import javax.faces.bean.ManagedBean
import javax.faces.bean.SessionScoped
@ManagedBean(name = "detailBean")
@SessionScoped
public class OfferDetailDelegate {
String test1 = "hello!";
String test2 = "there!";
}
当我启动tomcat时,我收到以下错误。我在class / build路径中看到了groovy。
com.sun.faces.config.AnnotationScanner processClassList
SEVERE: Unable to load annotated class:
com.xyz.offersworkbench.dao.delegate.OfferDetailDelegate, reason: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
有什么想法吗?
提前致谢!
答案 0 :(得分:1)
Groovy是在tomcat实例的类路径上吗?
听起来你需要将jar文件复制到lib中,tomcat可以找到它吗?