为了账号安全,请及时绑定邮箱和手机立即绑定

页面不能显示

public class StudentsAction extends SuperAction{


private static final long serialVersionUID = 1L;

public String query(){Go

StudentsDAO sdao = new StudentsDAOImpl();

List<Students> list = sdao.queryAllStudents();

if(list!=null&&list.size()>0)

{

session.setAttribute("students_list", list);

}

System.out.println(list.size());

return "query_success";

}

}

struts.xml:

   <package name="students"  namespace="/students" extends="default">  

         <action name="*_*" class="action.{1}Action" method="{2}">

       <result name="query_success">/students/Students_query_success.jsp</result>  

       </action>  

       </package>

tree.jsp:

var treeMenu = [

{ level:1, name:"学生管理"},

{ level:2, name:"学生列表", ico:"images/icon_default.gif",link:"students/Students_query.action"},

{ level:1, name:"教师管理"},

{ level:2, name:"教师列表", ico:"images/icon_default.gif",link:"role_list.html"},

{ level:1, name:"信息管理"},

{ level:2, name:"新闻管理", ico:"images/icon_default.gif",link:"news_list.html"},

{ level:2, name:"公告管理", ico:"images/icon_default.gif",link:"bulletin_list.html"},

{ level:1, name:"系统邮件", ico:"images/icon_default.gif"},

{ level:1, name:"网络文件", ico:"images/icon_default.gif",link:"complaint_list.html"}

];

Student_query_success.jsp:

<!-- 遍历开始 -->

<s:iterator value="#session.students_list" var="stu">

<tr class="list">

<td><s:property value="#stu.sid"/></td>

<td><s:property value="#stu.sname"/></td>

<td><s:property value="#stu.gender"/></td>

<td><s:date name="#stu.birthday" format="yyyy年MM月dd日"/></td>

<td><s:property value="#stu.address"/></td>

<td><a href="#">删除</a></td>

</tr>

</s:iterator>

<!-- 遍历结束 -->


正在回答

5 回答

c标签也是可以的,


<c:forEach items="${sessionScope.list }" var="stu">

<tr class="list">

<td><c:out value="${stu.sid }"></c:out></td>

<td><a href="<%=path%>/students/Students_modify.action?sid=${stu.sid}"><c:out value="${stu.sname }"></c:out></a></td>

<td><c:out value="${stu.gender }"></c:out></td>

<td><c:out value="${stu.birthday }"></c:out></td>

<td><c:out value="${stu.address }"></c:out></td>

<td><a href="<%=path%>/students/Students_delete.action?sid=${stu.sid}" onclick="javascript: return confirm('真的要删除吗?');">删除</a></td>

</tr>

</c:forEach>


0 回复 有任何疑惑可以回复我~
#1

jiayy 提问者

非常感谢!
2016-08-19 回复 有任何疑惑可以回复我~

<!-- 遍历开始 -->

<s:iterator value="#session.students_list"  id="stu">

<tr class="list">

<td><s:property value="#stu.sid"/></td>

<td><s:property value="#stu.sname"/></td>

<td><s:property value="#stu.gender"/></td>

<td><s:date name="#stu.birthday" format="yyyy年MM月dd日"/></td>

<td><s:property value="#stu.address"/></td>

<td><a href="#">删除</a></td>

</tr>

</s:iterator>

<!-- 遍历结束 -->

把var改成id

0 回复 有任何疑惑可以回复我~

top.document.frames["MainFrame"].location.href=link; 

javaScript代码问题,360浏览器不兼容

0 回复 有任何疑惑可以回复我~

右键点击在新窗口可以打开,好奇怪

0 回复 有任何疑惑可以回复我~
#1

Shawn_Mei

我用360浏览器遇到和你一样的问题,换成chrome就可以了···
2016-08-04 回复 有任何疑惑可以回复我~

数据库里面有内容,怎么都显示0

七月 24, 2016 12:33:10 下午 org.apache.jasper.compiler.TldLocationsCache tldScanJar

信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Hibernate: select students0_.SID as SID1_0_, students0_.sname as sname2_0_, students0_.gender as gender3_0_, students0_.birthday as birthday4_0_, students0_.address as address5_0_ from STUDENTS students0_



0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

页面不能显示

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信