日期:2014-05-17  浏览次数:20780 次

学生信息无法显示
我在这个action页面设置了如下信息(另外一个java页面设置了public class Manager { public int stuId; public String stuName;等属性):  
 public class ManaAction extends ActionSupport{
 
private Manager manager=new Manager();

public Manager getManager() {
return manager;
}

public void setManager(Manager manager) {
this.manager = manager;
}

public String select()throws Exception{
//显示该生的学籍信息
String s=request.getSession().getAttribute("stuId").toString();
int stuId=Integer.parseInt(s);  
ResultSet sqlSelect=Dbcon.executeQuery("select * from student where stuId='"+stuId+"'");
try{
if(sqlSelect.next()){
System.out.print("dfdf");
System.out.print(sqlSelect.getString("stuName"));
System.out.print(sqlSelect.getString("stuId"));
System.out.print(sqlSelect.getString("stuAge"));
System.out.print(sqlSelect.getString("password"));
System.out.print(sqlSelect.getString("sysId"));
Manager manager = new Manager();
manager.setStuId(Integer.valueOf(sqlSelect.getString("stuId")));
manager.setStuName(sqlSelect.getString("stuName"));
manager.setPassword(sqlSelect.getString("password"));
manager.setSpersonid(sqlSelect.getString("spersonid"));
manager.setStuAge(Integer.valueOf(sqlSelect.getString("stuAge")));
manager.setStuSex(sqlSelect.getString("stuSex"));
manager.setClaId(Integer.valueOf(sqlSelect.getString("claId")));
manager.setSysId(Integer.valueOf(sqlSelect.getString("sysId")));
manager.setSysId(Integer.valueOf(sqlSelect.getString("stuIma")));
sqlSelect.close();
}
}catch(Exception e){
e.printStackTrace();

}
return SUCCESS;
}
在显示页面设置了: <td height="35" width="200">密 码:<s:property value="manager.password" /></td>
但是为何页面什么信息都没有显示?而out.print这些数据都是能获取的。

------解决方案--------------------
Manager manager = new Manager();//这一句去掉