📄 checi_showaction.java
字号:
//在checi.jsp页面中,进行显示与更新的处理动作
package gongjiaochexitong.gongjiaoche.checi_pkg;
import gongjiaochexitong.gongjiaoche.*;
import gongjiaochexitong.gongjiaoche.main_pkg.*;
import java.util.Vector;
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;
public final class checi_showAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
checi_showForm checi_showform = (checi_showForm)form;
int checihao = checi_showform.getChecihao();
ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute("db_gongjiaoche");
conn_Bus db = new conn_Bus(dataSource);
HttpSession session = request.getSession();
if(checihao!=0 ){
//checi_procedure.showCheCiHao(db,checihao);
Vector v_checihao=new Vector();
Vector v_journey=new Vector();
v_checihao.add(checihao);
v_journey.add(procedure.isJourney(db,checihao));
try {
session.setAttribute(constants.SHOW_CHECIHAO,v_checihao);
session.setAttribute(constants.SHOW_JOURNEY,v_journey);
session.setAttribute(constants.SHOW_COURSE,procedure.search_CheCiHao(db,checihao));
} catch (Exception e) {
//System.out.println("出现异常:"+e);
e.printStackTrace();
}
db.conn_Close(); //close connection
return mapping.findForward("tocheci");
}
else{
db.conn_Close(); //close connection
return mapping.findForward("checi_showError");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -