【发布时间】:2013-07-23 12:00:57
【问题描述】:
我需要帮助,了解 JSF 与 Java 类文件的连接方式。 在我目前参与的项目中,它使用类对象将 JSF 与 Java 类连接起来。 但我不知道对象在哪里初始化。 在 Struts 中,我们通过 Struts.xml 将 JSP 与动作连接起来。但是在这里我没有看到任何映射,它只是使用
调用类名#{classNameObject.methodName}
这里classNameObject 是一个对象而不是类名。
我的问题是这个 #{classNameObject.methodName} 如何与 CLASSNAME 完全连接?
这里是代码示例
<p:dataTable id="dataTable" value="#{employeeList.empVarList}"
var="employee" emptyMessage="No Employees found" rows="15"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="10,15,20" rowIndexVar="rowIndex"
dynamic="false" cache="false" lazy="false"
style="display:block;overflow-y:none;overflow-x:auto;">
这里dataTable连接到EmployeeList类
它使用 JSF、primefaces、Spring、Hibernate
没有初始化为employeeList 除了这个
private List<Employee> employeeList = new ArrayList<Employee>();
除了休眠之外,我在上述所有方面都只有一周的经验。请帮我处理所有你得到的东西。提前致谢。
【问题讨论】:
-
它为此使用注释和反射。
-
这在 JSF 教程中有介绍(现在在提供的答案中)。
标签: spring hibernate jsf primefaces