src/com/action/TeacherManager.java
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.action;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.bean.*;
import com.dao.*;
public class TeacherManager extends ActionSupport {
//下面是Action内用于封装用户请求参数的属性
private List<TeacherBean> list;
public List<TeacherBean> getList() {
return list;
}
public void setList(List<TeacherBean> list) {
this.list = list;
}
private String SearchRow;
private String SearchKey;
public String getSearchRow() {
return SearchRow;
}
public void setSearchRow(String searchRow) {
SearchRow = searchRow;
}
public String getSearchKey() {
return SearchKey;
}
public void setSearchKey(String searchKey) {
SearchKey = searchKey;
}
//处理用户请求的execute方法
public String execute() throws Exception {
//解决乱码,用于页面输出
HttpServletResponse response=null;
response=ServletActionContext.getResponse();
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
//创建session对象
HttpSession session = ServletActionContext.getRequest().getSession();
//验证是否正常登录
if(session.getAttribute("id")==null){
out.print("<script language='javascript'>alert('请重新登录!');window.location='Login.jsp';</script>");
out.flush();out.close();return null;
}
//查询条件
String strWhere="1=1";
if(!(isInvalid(SearchKey)))
{
strWhere+=" and "+SearchRow+"='"+SearchKey+"'";
}
后面还有 18 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。