MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 请教JSTL标签有关问题

请教JSTL标签有关问题

www.myexceptions.net  网友分享于:2013-11-08  浏览:229次
请教JSTL标签问题
在JSP里,用<HTML:SELECT>就能把LIST里的值遍历出来,用<select>+<c:foreach>标签就不行,JSP页面的代码如下,请高手多多指教
<%@ page language="java"%>
<%@ page contentType="text/html;charset=GB2312"%>
<%@ page import="java.util.*"%>
<%@ page import="com.hwhd.entity.Lesson"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List list = (List)request.getAttribute("list");
if(list != null){
System.out.println("Test is success!");
for(int j = 0;j<list.size();j++){
Lesson l = (Lesson)list.get(j);
System.out.println("term--->"+l.getTerm()+"|||id--->"+l.getId());
}
}else{
System.out.println("error break!");
}
List tt = (List)request.getAttribute("type");
if(tt != null){
for(int i=0;i<tt.size();i++){
Lesson l = (Lesson) tt.get(i);
System.out.println(l.getStudent_type());
}
}

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html>
  <head>
  <base href="<%=basePath%>">
  <title>timeRual.jsp</title>
  <script id="chromeless" src="<%=path%>/css/script/pz_chromeless_2.1.js"></script>
<link rel="stylesheet" href="<%=path%>/css/9ptext.css" type="text/css">
<link rel="stylesheet" href="<%=path%>/css/Pub.css" type="text/css">
<style type="text/css">
 .qctcCalendar{behavior:url(<%=path%>/css/QctcCalendar.htc);}
 td{font-size:12px}
</style>
  </head>
  <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td height="2"></td>
  </tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
  <td height="18">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td width="5%"><img src="<%=path%>/images/pub/PubTitleLeft.jpg"></td>
  <td width="90%" valign="bottom" background="<%=path%>/images/pub/PubTitleMiddle.jpg">
  <div align="center" class="bttext">选课时间设置</div></td>
  <td width="3%"><img src="<%=path%>/images/pub/PubTitleRight.jpg"></td>
  </tr>
  </table>
  </td>
  </tr>
  <tr> 
  <td valign="top" width="90%">
  <html:form method="post" action="/timeRual">
  <table width="98%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cecfce" bordercolordark="#ffffff">

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有