资源简介
基于Java实现的一个网页版的火车票订票系统
代码片段和文件信息
package com.csu.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import com.csu.bean.Passenger;
import com.csu.form.PassengerForm;
import com.csu.manager.PassengerManager;
public class PassengerAction extends DispatchAction {
private PassengerManager passengerManager;
public void setPassengerManager(PassengerManager passengerManager) {
this.passengerManager = passengerManager;
}
@Override
protected ActionForward unspecified(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
return null;
}
public ActionForward register(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
PassengerForm passengerForm = (PassengerForm) form;
Passenger passenger = new Passenger();
BeanUtils.copyProperties(passenger passengerForm);
passengerManager.addPassenger(passenger);
request.setAttribute(“message“ “恭喜您注册成功!“);
return mapping.findForward(“register_ok“);
}
public ActionForward delete(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
PassengerForm passengerForm = (PassengerForm) form;
passengerManager.deletePassenger(passengerForm.getId());
request.setAttribute(“message“ “删除成功!“);
return mapping.findForward(“delete_ok“);
}
public ActionForward update(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
PassengerForm passengerForm = (PassengerForm) form;
Passenger passenger = new Passenger();
BeanUtils.copyProperties(passenger passengerForm);
passengerManager.updatePassenger(passenger);
request.getSession().setAttribute(“passenger“ passenger);
request.setAttribute(“message“ “修改成功!“);
return mapping.findForward(“update_ok“);
}
public ActionForward findPassenger(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
PassengerForm passengerForm = (PassengerForm) form;
if(request.getSession().getAttribute(“passenger“)==null){
request.setAttribute(“message“ “您还没有登录请先登录!“);
return mapping.findForward(“error“);
}
passengerManager.findPassenger(passengerForm.getId());
return mapping.findForward(“passenger“);
}
public ActionForward login(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception {
PassengerForm passengerForm = (PassengerForm) form;
String passenger_account = passengerForm.getPassenger_account();
String password = passengerForm.getPassword();
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2759 2010-01-19 18:05 train_booking\.classpath
文件 313 2010-01-19 18:06 train_booking\.myme
文件 1419 2010-01-19 18:05 train_booking\.project
文件 406 2010-01-19 18:05 train_booking\.settings\.jsdtscope
文件 1040 2010-01-19 18:05 train_booking\.settings\com.genuitec.eclipse.j2eedt.core.prefs
文件 96 2010-01-19 18:05 train_booking\.settings\org.eclipse.core.resources.prefs
文件 137 2010-01-19 18:05 train_booking\.settings\org.eclipse.ltk.core.refactoring.prefs
文件 49 2010-01-19 18:05 train_booking\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2010-01-19 18:05 train_booking\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1594 2010-01-19 18:05 train_booking\src\applicationContext-commons.xm
文件 1220 2010-01-19 18:05 train_booking\src\applicationContext-web.xm
文件 3690 2010-01-19 18:05 train_booking\src\com\csu\action\PassengerAction.java
文件 6877 2010-01-19 18:05 train_booking\src\com\csu\action\TicketAction.java
文件 4288 2010-01-19 18:05 train_booking\src\com\csu\action\TrainAction.java
文件 906 2010-01-19 18:05 train_booking\src\com\csu\bean\Passenger.hbm.xm
文件 2062 2010-01-19 18:05 train_booking\src\com\csu\bean\Passenger.java
文件 710 2010-01-19 18:05 train_booking\src\com\csu\bean\Ticket.hbm.xm
文件 1337 2010-01-19 18:05 train_booking\src\com\csu\bean\Ticket.java
文件 842 2010-01-19 18:05 train_booking\src\com\csu\bean\Train.hbm.xm
文件 1815 2010-01-19 18:05 train_booking\src\com\csu\bean\Train.java
文件 1537 2010-01-19 18:05 train_booking\src\com\csu\filter\AuthorizeFilter.java
文件 1934 2010-01-19 18:05 train_booking\src\com\csu\form\PassengerForm.java
文件 1425 2010-01-19 18:05 train_booking\src\com\csu\form\TicketForm.java
文件 1494 2010-01-19 18:05 train_booking\src\com\csu\form\TrainForm.java
文件 725 2010-01-19 18:05 train_booking\src\com\csu\manager\PassengerManager.java
文件 1616 2010-01-19 18:05 train_booking\src\com\csu\manager\PassengerManagerImpl.java
文件 1497 2010-01-19 18:05 train_booking\src\com\csu\manager\TicketManager.java
文件 4577 2010-01-19 18:05 train_booking\src\com\csu\manager\TicketManagerImpl.java
文件 947 2010-01-19 18:05 train_booking\src\com\csu\manager\TrainManager.java
文件 2452 2010-01-19 18:14 train_booking\src\com\csu\manager\TrainManagerImpl.java
............此处省略116个文件信息
相关资源
- Java把html生成pdf (xhtmlrenderer)
- 利用Java语言编写的学生通讯录管理系
- javaee图书管理系统85116
- 使用nrf52832的SPI驱动LIS3DH参考androidj
- mysql-connector-java-5.1.39
- Eclipse3.2.1中文版(11)
- Java 中国象棋 v2.1
- java医院预约挂号管理系统毕业设计程
- java基于WEB网页点餐系统毕业设计程序
- 电子地图模块java源码
- Java NetWork Programming 4th
- Data structures and algorithms in java 6th
- 物流管理系统 java+sqlserver+tomcat毕业设
- Effective_Java_2nd_Edition_中文和英文Book
- JAVA 俄罗斯方块, 客户端+服务端,
- J2S2JJava2Smali2Java
- javaWeb汽车销售系统
- Sun J2EE 宠物店包括源代码及参考书
- Jsp+mysql员工管理系统工资和部门
- Java语言程序设计(基础篇)课后习题
- java Socket实现聊天程序
- java项目——家具销售管理项目
- Java实现webQQ聊天完整代码
- JAVA JSP旅游区旅游管理系统 源代码 论
- SuperVCD管理系统 java版完整代码 带各种
- 分享一个Android和java调用RESTful Web服务
- Java虚拟机的设计和实现
- java美容院管理系统设计与实现毕业设
- Java程序员面试宝典-杨磊_高清版[带完
- java Web审批流程
评论
共有 条评论