src/cn/itbaizhan/health/action/TeacherAction.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package cn.itbaizhan.health.action;
import java.util.Map;
import cn.itbaizhan.health.action.base.TeacherBaseAction;
import cn.itbaizhan.health.po.Teacher;
import cn.itbaizhan.health.vo.Pages;
import com.opensymphony.xwork2.ActionContext;
public class TeacherAction extends TeacherBaseAction {
public String login() {
try {
if ("".equals(teacher.getName()) || null == teacher.getName()
|| "".equals(teacher.getPassword())
|| null == teacher.getPassword()) {
errorMessage = "请输入完整信息登录!";
return "error";
}
Teacher teacher0 = teacherService.find(teacher);
if (null != teacher0) {
ActionContext actionContext = ActionContext.getContext();
Map<String, Object> session = actionContext.getSession();
session.put("teacher", teacher0);
return SUCCESS;
}
} catch (Exception e) {
e.printStackTrace();
}
errorMessage = "登录失败,请先注册或验证密码重新登录!";
return "error";
}
public String logout() {
ActionContext actionContext = ActionContext.getContext();
Map<String, Object> session = actionContext.getSession();
if (null != session.get("teacher")) {
session.remove("teacher");
return SUCCESS;
}
errorMessage = "注销失败!";
return "error";
}
public String add() {
try {
Teacher t=teacherService.add(teacher);
ActionContext actionContext = ActionContext.getContext();
Map<String, Object> session = actionContext.getSession();
session.put("teacher", t);
return SUCCESS;
} catch (Exception e) {
e.printStackTrace();
}
return "error";
}
public String teacherBackFindAll() {
try {
if (pages == null) {
pages = new Pages();
后面还有 26 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
