struts.xml 这是 Struts 类
请告诉我使用strut2 hibernate JPA 更新的正确方法关于按 id 更新
<struts>
<package name="com.Attendance" extends="struts-default">
<action name="RegTeacher" class="com.Attendance.TeacherAction" >
<result name="success">/Admin/success.jsp</result>
<result name="error">/Admin/RegistrationTeacher.jsp</result>
<result name="input">/Admin/RegistrationTeacher.jsp</result>
</action>
<action name="EditTeacher" class="com.Attendance.TeacherAction"
method="FindById">
<result name="success">/Admin/UDTeacher.jsp</result>
<result name="input">/Admin/ShowAllTeacher.jsp</result>
</action>
<action name="UDTeacher" class="com.Attendance.TeacherAction"
method="Update">
<result name="success">/Admin/success.jsp</result>
<result name="error">/Admin/UDTeacher.jsp</result>
<result name="input">/Admin/UDTeacher.jsp</result>
</action>
</package>
<constant name="struts.action.excludePattern"
value="/CheckCode,/CheckRegistrationAdmin," />
</struts>`
RegTeacher 这是模型/实体类
请告诉我用strut2 hibernate JPA更新的正确方法关于按id更新
` package com.Attendance;
import javax.persistence.*;
@Entity
@Table(name="Teacher")
public class RegTeacher{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name = "id", nullable = false)
private int id;
@Column(name = "LecturerName",unique=true,nullable=false)
private String Name;
@Column(name= "email",unique=true,nullable=false)
private String email;
@Column(name= "pass",nullable=false)
private String Password;
@Column(name="Course",nullable=false)
private String CourseT;
@Column(name= "ClassName",nullable=false)
private String CName;
/** setter and getter **/
}`
TecaherAction 这是 Action 类
BIG阳
相关分类