jsp页面初始化的问题,进入不去,大神指点一下!

零单 零单 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
就是user==null,return "list";。进不去userDao.selcetall方法。我估计是在JSP里面出问题,但是看了半天不懂怎么解决,大神帮忙解决一下

ACTION
public String list(){
if(this.getPage()==null){
this.setPage(new Page());
}

List<Gjt_User>list=new ArrayList<Gjt_User>();

if (user!=null) {
System.out.println("...................进入到useraction");
Map<String, Object> param=new HashMap<String, Object>();
param.put("username", user.getUsername());
param.put("userphone", user.getUserphone());
list=userDao.selcetall(param);

this.page.setTotalRows(userDao.count(param));
param.put("page", this.page);
list=userDao.selcetall(param);

request.setAttribute("list", list);
}

return "list";

JSP
<body>
<form name="fom" id="fom" method="post" action="${pageContext.request.contextPath }/user_list.do">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
<td height="30">

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="62" background="../images/nav04.gif">

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="21"></td>
<td width="300">按用户名查询:
<input name="" type="text" size="12" />
<s:submit cssClass="right-button02" value="查询"></s:submit>
</td>
</table></td>
</tr>
<tr>
<td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>
<td height="40" class="font42"><table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">


<tr>
<td width="10%" height="20" align="center" bgcolor="#EEEEEE">用户名</td>
<td width="10%" align="center" bgcolor="#EEEEEE">所属部门</td><!--
<td width="10%" align="center" bgcolor="#EEEEEE">对应权限</td>
--><td width="9%" align="center" bgcolor="#EEEEEE">姓名</td>
<td width="5%" align="center" bgcolor="#EEEEEE">性别</td>
<td width="6%" align="center" bgcolor="#EEEEEE">年龄</td>
<td width="10%" align="center" bgcolor="#EEEEEE">电话</td>
<td width="15%" align="center" bgcolor="#EEEEEE">邮箱</td></tr>
<s:iterator value="#request.list" var="user" status="states">
<tr>
<td height="20" bgcolor="#FFFFFF"><div align="center"> <s:property value="#user.id"/></div></td>
<td height="20" bgcolor="#FFFFFF"><div align="center"> <s:property value="#user.username"/></div></
</tr>
</s:iterator>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="6"><img src="../images/spacer.gif" width="1" height="1" /></td>
<s:include value="/common/pager.jsp"></s:include>
</tr>
<tr>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

</form>
</body>
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
零单
Web 开发 81,108 成员 341,721 内容