我在登陆的时候,把id读取出时转换成了string类型,同时放到了session中,但是我在另一个页面读取session中这个id的时候,我怎末把类型转换成为int,从而能使我在数据库中读取出相应的数据呀》?
我在之前转换是时候是: int stuId1=sqlSelect.getInt("stuId");
String stuId=Integer.toString(stuId1);
session.put("stuId",stuId1);
而在令一个页面根据id读取的时候是:HttpServletRequest request=ServletActionContext.getRequest();
int stuId=Integer.parseInt(request.getSession().getAttribute("stuId"));(这里提示错误)
public String select()throws Exception{
ResultSet sqlSelect=Dbcon.executeQuery("select * from student where stuId='"+stuId+"'");
try{
我在之前转换是时候是: int stuId1=sqlSelect.getInt("stuId");
String stuId=Integer.toString(stuId1);
session.put("stuId",stuId1);
而在令一个页面根据id读取的时候是:HttpServletRequest request=ServletActionContext.getRequest();
int stuId=Integer.parseInt(request.getSession().getAttribute("stuId"));(这里提示错误)
public String select()throws Exception{
ResultSet sqlSelect=Dbcon.executeQuery("select * from student where stuId='"+stuId+"'");
try{
但是还是不能显示信息,本来之前是可以正常显示的,但是不知道今天是怎末了,在页面上我用<s:iterator value="manaList">来进行显示,只显示出一个乱了的表格,里面连文字都没有。而且tomcatd里面的错误信息是:for input string:"463A5C646F206D7920……………………"还显示我的代码有点问题:ResultSet sqlSelect=Dbcon.executeQuery("select * from student where stuId='"+stuId+"'");
try{
if(sqlSelect.next()){
System.out.print("dfdf");
Manager manager = new Manager();
manager.setStuId(Integer.valueOf(sqlSelect.getString("stuId")));
manager.setStuName(sqlSelect.getString("stuName"));
manager.setPassword(sqlSelect.getString("password"));
manager.setSpersonid(sqlSelect.getStri
int stuId=Integer.parseInt(request.getSession().getAttribute("stuId").toString())