jsp页面初始化的问题,进入不去,大神指点一下!
就是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>
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>
...全文
相关推荐
idea springboot 修改css,jsp不重启实现页面更新的问题
主要介绍了idea springboot 修改css,jsp不重启实现页面更新的问题,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
图片上传成功jsp页面不刷新问题
图片上传成功jsp页面不刷新,是因为浏览器缓存导致,需要在图片请求参数中添加随机参数
解决jsp页面中文乱码问题
NULL 博文链接:https://prowl.iteye.com/blog/483854
ajax 提交数据到后台jsp页面及页面跳转问题
ajax 提交数据到后台jsp页面及页面跳转问题 我logincheck.jsp页面取传参数代码: String user=request.getParameter("user1"); String pwd=request.getParameter("pwd1"); login.jsp input 取2参数何用ajax 传给logincheck.jsp $.ajax({ type : "POST", url : baseUrl+"m/module/querymodulebyname.do", dataType:"json", data: { modName:title }, succes
JSP页面表格初始化
一个页面表格初始化的源代码,希望对你们有帮助!


Web 开发
