【发布时间】:2014-06-28 15:33:38
【问题描述】:
基于advice to use JSF,希望运行following sample 以了解更多关于JSF 的信息并将该技术实现到servlet 中。但是,一些库无法导入:
package tobedefinedservlet;
import javax.faces.bean.ManagedBean;
@ManagedBean
public class Hello {
final String world = "Hello World!";
public String getworld() {
return world;
}
}
javax.faces
The import javax.faces cannot be resolved
ManagedBean
ManagedBean cannot be resolved to a type
【问题讨论】:
-
你用的是什么版本的java?
-
您确定您在应用程序的类路径中包含了一个 JSF 库,例如 Mojarra?
-
我再次检查了java构建路径,导入了不正确的jar。错误现在消失了。谢谢。
-
@QueryLars 您应该将其添加为答案。
-
这个链接会对你有所帮助。 stackoverflow.com/a/46019133/4783846
标签: eclipse jsf import java-8 java