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

怎样设置JSP断点查看数值有没有传进来?
小弟我写了个通过ID查询另外一个表的数值,怎样设置断点看数值有没有传进来?
public int getUser(UserInfo userInfo,UserGroupInfo userGroupInfo){
int result=0;
String sql="select UserGroupInfo.groupName,UserInfo.UGroupId from UserGroupInfo,UserInfo where UserGroupInfo.UGroupId=UserInfo.UGroupId";

UserInfo user=null;
UserGroupInfo group=null;

try {
con=DBConn.getCon();
ps=con.prepareStatement(sql);
rs=ps.executeQuery();
if(rs.next()){
user=new UserInfo();
group=new UserGroupInfo();
user.setUGroupId(rs.getInt("UGroupId"));
group.setUGroupId(rs.getInt("UGroupId"));
* 此处设断点吗? group.setGroupName(rs.getString("groupName"));
}

} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
DBConn.closeAll(con, ps, rs);
}
return result;
}
用debug怎样查看数值有没有传进来?
JSP页面的获取方法为:
<%
UserInfo user=new UserInfo();
UserGroupInfo group = new UserGroupInfo();
ShowDao showDao= new ShowDao();
int count=showDao.getUser(user,group);
%>
。。。
<%=group.getGroupName() %>
望哪位大侠指点

------解决方案--------------------
不知道调试就直接在jsp页面上打印呗,这个不要去伤脑筋啦
------解决方案--------------------
System.out.print();
输出rs.getString("groupName")
看看是什么值

------解决方案--------------------
探讨
System.out.print();
输出rs.getString("groupName")
看看是什么值

------解决方案--------------------
JSP上可以设置断点,但是看不到数据。所以建议通过打印的方式查看数据