@RequestMapping("/findCars")
public String findCars(HttpSession session,String startStationName,String endStationName,String startedTime,Integer flag) {
/*三者值均不能为空*/
if(StringUtil.isEmpty(startStationName) || StringUtil.isEmpty(startedTime) ||StringUtil.isEmpty(endStationName))
{
if (flag == 1)//现在肯定为2啊???
{
return "pages/advancedsearch";
} else {
return "pages/home";
}
}
Date tDate = DateUtil.transFormDateToDate(startedTime);
if (tDate != null)
{
List<Car> trainAndTicketList =
searchCarService.getCarList(startStationName, endStationName, tDate, flag);
if (flag == 1)
{
session.setAttribute("adtatList", trainAndTicketList);
session.setAttribute("isAdPostResponse", true);
} else {
session.setAttribute("tatList", trainAndTicketList);
session.setAttribute("isPostResponse", true);
}
}
为什么这样写
${elemCar.Car.startTime}取不到值??我的Car是这样的
public class Car {
private Date startTime;
//出发地
private String startStationName;
//达到地
private String endStationName;
//车型
private String carType;
//价钱
private Integer carPrice;
getter,setter toString都写好了。。。。省略去
}
页面报错如下
The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: An exception occurred processing [/pages/home.jsp] at line [161]
158:
159:
160:
161: ${elemCar.Car.startTime}