bug如图所示
org.apache.jasper.JasperException: java.lang.NumberFormatException: For input string: "g_id"
public String selectApply1() throws Exception{
System.out.print("进入selectApplyGoods查看公司人员请购方法,");
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession(false);
System.out.println("获取session成功!");
User user = (User)session.getAttribute("user");
int uid = userService.uidUser(user);
System.out.print(uid+"huoqvle");
user.setU_id(uid);
applyGoodsLook = goodsService.selectApplyGoods(user);
System.out.print(applyGoodsLook);
return "apply_goods_success";
}
public List<Map<String, Object>> selectApplyGoods(User user) throws Exception{
System.out.print("进入selectApplyGoods请购商品查看service方法,");
List<Map<String, Object>> applyGoodsLook = goodsDao.selectAppGoods(user);
return applyGoodsLook;
}
public List<Map<String, Object>> selectAppGoods(User users) throws Exception{
System.out.print("进入selectAppGoods请购Dao方法,");
System.out.println(users.getU_id());
String sql = "select t1.g_id,t1.g_gid,t1.g_name,t1.g_number,t1.g_price,t1.g_introduce,t1.g_state from tb_goods t1 left join user_goods t2 on t1.g_id=t2.g_id left join tb_user t3 on t2.u_id=t3.u_id where t1.g_state='已请购' and t3.u_id='"+users.getU_id()+"'";
List<Map<String, Object>> query = this.getSession().createSQLQuery(sql).list();
/*String sql1 = "select g_id from user_goods where u_id='"+users.getU_id()+"'";
Integer gid = ((Number)(this.getSession().createSQLQuery(sql1)).uniqueResult()).intValue();
String sql2 = "select * from tb_goods where tb_goods.g_state='已请购' and tb_goods.g_id='"+gid+"'";
List<Map<String, Object>> query = this.getSession().createSQLQuery(sql2).list();*/
return query;
}