AddFlightAction (2)action的代码

package com.obtk.actions;

import com.obtk.dao.FlightDAO;
import com.obtk.entity.Flight;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
/**
* 添加航班
* @author chengzheng
*
*/
public class AddFlightAction extends ActionSupport implements ModelDriven<Flight>{
private FlightDAO dao=new FlightDAO();
private Flight flight;
public Flight getModel() {
flight=new Flight();
return flight;
}


@Override//添加航空 所有的值都没有传递过来
public String execute() throws Exception {
String result=dao.addFlight(flight);
if(result.equals("addsuccess")){
return "success";
}else{
System.out.println(result);
return "input";

}


}

}

posted @ 2016-01-25 19:49  chengzheng  阅读(82)  评论(0编辑  收藏  举报