📄 checi_action.java
字号:
//进入checi.jsp页面时,从数据库中获取车次信息
package gongjiaochexitong.gongjiaoche.checi_pkg;
import gongjiaochexitong.gongjiaoche.*;
import gongjiaochexitong.gongjiaoche.main_pkg.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import javax.servlet.ServletContext;
import javax.sql.DataSource;
import java.util.*;
public final class checi_Action extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute("db_gongjiaoche");
conn_Bus db = new conn_Bus(dataSource);
HttpSession session = request.getSession();
//String member=session.getAttribute(constants.MEMBER).toString();
//String power=session.getAttribute(constants.POWER).toString();
try {
Vector checi_list=procedure.getCheCi_List(db); //这里的站点是站点号,须转换
session.setAttribute(constants.CHECI_LIST_KEY2,checi_procedure.stationNo2stationName(db,checi_list));
} catch (Exception e) {
//System.out.println("出现异常:"+e);
e.printStackTrace();
}
db.conn_Close(); //close connection
return mapping.findForward("tocheci");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -