i 有一名有管理的美籍讲师。 讲演人管理的神职人员包括各部之间的关系。 我愿向数据库中储存的所有部门介绍情况。 当一名讲师注册时,需要找到自己的部门。
我的讲师管理了神父。 i 具备适当的固定装置和接力方法。 i 仅略作澄清。
public class Lecturer
{
private String name;
private String surname;
private String email;
private String username;
private String password;
private List<Department> departments;
private LecturerService lecturerService;
private DepartmentService departmentService;
}
我的李克里。 xhtml file:
<h:form>
<f:view>
<p:panelGrid columns="2">
<f:facet name="header">Lecturer Registration Form</f:facet>
<h:outputLabel for="name" value="Name :" />
<p:inputText id="name" value="#{Lecturer.name}" label="Name" required="true" />
<h:outputLabel for="surname" value="Surname :" />
<p:inputText id="surname" value="#{Lecturer.surname}" label="Surname" required="true" />
<h:outputLabel for="department" value="Department :" />
<p:selectOneMenu value="#{Lecturer.departments}" effect="fade" editable="true" var="p" >
<f:selectItem itemLabel="Select One" itemValue="" />
<f:selectItems value="#{Lecturer.departments}" var="lec"
itemLabel="#{lec.name}" itemValue="#{lec.name}"/>
</p:selectOneMenu>
<h:outputLabel for="email" value="Email :" />
<p:inputText id="email" value="#{Lecturer.email}" label="Email" required="true" />
<h:outputLabel for="username" value="User Name :" />
<p:inputText id="username" value="#{Lecturer.username}" label="Email" required="true" />
<h:outputLabel for="password" value="Password :" />
<p:inputText id="password" value="#{Lecturer.password}" label="Password" required="true" />
<f:facet name="footer">
<p:commandButton type="submit"
id="lecturer"
action="#{Lecturer.registerLecturer}"
value="Register" icon="ui-icon-disk">
</p:commandButton>
</f:facet>
</p:panelGrid>
</f:view>
</h:form>
我的脸谱。
<managed-bean>
<managed-bean-name>Lecturer</managed-bean-name>
<managed-bean-class>com.studinfo.controller.Lecturer</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>departmentService</property-name>
<property-class>com.studinfo.services.DepartmentService</property-class>
<value>#{DepartmentService}</value>
</managed-property>
<managed-property>
<property-name>lecturerService</property-name>
<property-class>com.studinfo.services.LecturerService</property-class>
<value>#{LecturerService}</value>
</managed-property>
</managed-bean>
一、删除选择 A. 1Menu tag。 我的网页运转良好。
对解决办法的任何想法?
是否有必要在扼杀和部门之间增加变换者?