有个问题就是我想在<nested:iterator>标签内部用<bean:define>标签去定义一些变量
显然<nested:iterator>循环几次就有几个对象要被定义的
那么<bean:define>标签中的 id 属性就不能写成固定的了
因为<nested:iterator>标签里边有index
是这样写的<nested:iterator>标签<nested:iterator index="index" ……>
……
</nested:iterator>自作聪明的这样在<nested:iterator>标签中写<bean:define>标签<nested:iterator index="index" ……>
……
<bean:define id="definedObj${index}" ……>
……
</bean:define>
</nested:iterator>得到的结果是<bean:define>标签中的id不能为变量
哪位帮个忙看看怎么弄
谢谢
显然<nested:iterator>循环几次就有几个对象要被定义的
那么<bean:define>标签中的 id 属性就不能写成固定的了
因为<nested:iterator>标签里边有index
是这样写的<nested:iterator>标签<nested:iterator index="index" ……>
……
</nested:iterator>自作聪明的这样在<nested:iterator>标签中写<bean:define>标签<nested:iterator index="index" ……>
……
<bean:define id="definedObj${index}" ……>
……
</bean:define>
</nested:iterator>得到的结果是<bean:define>标签中的id不能为变量
哪位帮个忙看看怎么弄
谢谢
解决方案 »
- java注解@Resource机制如何取到注入过的Bean
- 怎么样让DOJO树在添加信息后自动展开结点并显示添加?
- jsp加载写好的class报错,看看我哪个地方做的有问题?
- 关于dwr和spring的页面迁移问题
- 大家讨论一下在java窗体里如何把数据库里的数据生成报表并打印出来,就像VB里的报表一样.
- 大家觉得外包到ibm公司去做测试,怎么样?
- 已经装了jdk 1.4,现在装javabean development kit (BDK1.1)安装过程中有一步是choose virtual machine ,java虚拟机
- 请问何为xsl?我觉得新版的论坛的xml+xsl的技术很好,想学习,看些什么书呢?请指点!
- 奇怪Hibernate 查询对象成功后控制台输出update语句
- 关于pergen space
- AJAX求助
- 求java webservice简单实例
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题页 </title> <style type="text/css"> .nTab{ float: left; width: 100%; margin: 0 auto; border-bottom:1px #AACCEE solid; background:#d5d5d5; background-position:left; background-repeat:repeat-y; margin-bottom:2px; } .nTab .TabTitle{ clear: both; height: 22px; overflow: hidden; } .nTab .TabTitle ul{ border:0; margin:0; padding:0; } .nTab .TabTitle li{ float: left; width: 70px; cursor: pointer; padding-top: 4px; padding-right: 0px; padding-left: 0px; padding-bottom: 2px; list-style-type: none; font-size: 12px; text-align: center; margin: 0; } .nTab .TabTitle .active{background:#fff;border-left:1px #AACCEE solid;border-top:1px #AACCEE solid;border-right:1px #AACCEE solid;border-bottom:1px #fff solid;} .nTab .TabTitle .normal{background:#EBF3FB;border:1px #AACCEE solid;} .nTab .TabContent{ width:auto;background:#fff; margin: 0px auto; padding:10px 0 0 0; border-right:1px #AACCEE solid;border-left:1px #AACCEE solid; } .none {display:none;} </style> <script type="text/javascript"> function nTabs(thisObj,Num){ if(thisObj.className == "active")return; var tabObj = thisObj.parentNode.id; var tabList = document.getElementById(tabObj).getElementsByTagName("li"); for(i=0; i <tabList.length; i++) { if (i == Num) { thisObj.className = "active"; document.getElementById(tabObj+"_Content"+i).style.display = "block"; }else{ tabList[i].className = "normal"; document.getElementById(tabObj+"_Content"+i).style.display = "none"; } } } </script> </head> <body> <br /> <br /> <div align="center" style="padding-left:25px;"> <div class="nTab" style=width:288px> <div class="TabTitle"> <ul id="myTab1"> <li class="active" onclick="nTabs(this,0);">aaa </li> <li class="normal" onclick="nTabs(this,1);">bbb </li> <li class="normal" onclick="nTabs(this,2);">ccc </li> <li class="normal" onclick="nTabs(this,3);">单击 </li> </ul> </div> <div class="TabContent"> <div id="myTab1_Content0"> 000 </div> <div id="myTab1_Content1" class="none"> 111 </div> <div id="myTab1_Content2" class="none"> 222 </div> <div id="myTab1_Content3" class="none"> 333 </div> </div> </div> </div> </body> </html>
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>选项卡</title>
<style type="text/css">
<!--
* { margin:0; padding:0; font-size:12px; font-weight:normal; }
.jj { font-weight:bolder!important; }
.box { border-top-color:#c00!important; }
.pr { color:#060!important; }
#tab01 { position:relative; width:336px; height:88px; padding-top:15px; margin:50px; overflow:hidden; }
#tab01 h3 { position:relative; z-index:2; float:left; height:14px; padding:0 7px 0 8px; margin-left:-1px; border-left:solid 1px #ccc; border-right:solid 1px #fff; text-align:center; background:#fff; cursor:pointer; }
#tab01 h3.up { height:18px; padding:5px 7px 0 7px; margin:-6px 0 0 0; border:solid #ccc; border-width:1px 1px 0; color:#c00; }
#tab01 div { display:none; position:absolute; left:0; top:32px; z-index:1; width:324px; height:54px; padding:5px; border:solid 1px #ccc; color:#666; }
#tab01 div.up { display:block; }
#tab02 { position:relative; width:200px; margin:50px; border:solid #ccc; border-width:0 1px 1px; }
#tab02 h4 { height:18px; line-height:18px; border:solid #ccc; border-width:1px 0; margin-bottom:-1px; text-align:center; background:#f6f6f6; cursor:pointer; }
#tab02 h4.up { color:#c00; }
#tab02 ol { display:none; height:54px; padding:5px; color:#666; }
#tab02 ol.up { display:block; }
#tab03 { position:relative; width:100px; margin:50px; }
#tab03 h3 { position:relative; z-index:1; height:16px; padding-top:4px; margin-bottom:-1px; border:solid #ccc; border-width:1px 0 1px 1px; text-align:center; font-family:宋体; background:#eee; cursor:pointer; }
#tab03 h3.up { z-index:3; color:#c00; background:#fff; }
#tab03 div.tab { display:none; position:absolute; left:99px; top:0; z-index:2; width:300px; height:200px; padding:5px; border:solid 1px #ccc; color:#666; }
#tab03 div.tab.up { display:block; }
-->
</style>
</head>
<body>
<div id="tab01">
<h3>首页</h3>
<div class="jj"><p>嘿嘿,无视div原始class值。</p></div>
<h3 class="pr">测试</h3>
<div><p>继续无视h3原始class值。</p></div>
<h3>无聊</h3>
<div><p>h3没有值也可以~</p></div>
<h3 class="box">傻蛋</h3>
<div><p>div没有值一样可以~</p></div>
</div>
<div id="tab02">
<h4>首页</h4>
<ol class="pr"><li>嘿嘿,无视容器原始class值。</li></ol>
<h4 class="box">测试</h4>
<ol><li>继续无视h3原始class值。</li></ol>
<h4>无聊</h4>
<ol><li>h3没有值也可以~</li></ol>
<h4 class="bb">傻蛋</h4>
<ol><li>div没有值一样可以~</li></ol>
</div>
<div id="tab03">
<h3>首页</h3>
<div class="tab"><p>嘿嘿,无视h3原始class值。</p></div>
<h3>测试</h3>
<div class="tab wushi"><p>继续无视div原始class值。</p></div>
<h3>无聊</h3>
<div class="tab"><p>h3没有值也可以~</p></div>
<h3 class="box">傻蛋</h3>
<div class="tab tab123"><p>class值相似一样也可以~</p><div><p>指定class后,即时再多一个div也行。</p></div></div>
</div>
<script type="text/javascript">
<!--
function Pid(id,tag){
if(!tag){
return document.getElementById(id);
}
else{
return document.getElementById(id).getElementsByTagName(tag);
}
}function tab(id,hx,box,iClass,s,pr){
var hxs=Pid(id,hx);
var boxs=Pid(id,box);
if(!iClass){ // 如果不指定class,则:
boxsClass=boxs; // 直接使用box作为容器
}
else{ // 如果指定class,则:
var boxsClass = [];
for(i=0;i<boxs.length;i++){
if(boxs[i].className.match(/\btab\b/)){// 判断容器的class匹配
boxsClass.push(boxs[i]);
}
}
}
if(!pr){ // 如果不指定预展开容器,则:
go_to(0); // 默认展开序列
yy();
}
else {
go_to(pr);
yy();
}
function yy(){
for(var i=0;i<hxs.length;i++){
hxs[i].temp=i;
if(!s){// 如果不指定事件,则:
s="onmouseover"; // 使用默认事件
hxs[i][s]=function(){
go_to(this.temp);
}
}
else{
hxs[i][s]=function(){
go_to(this.temp);
}
}
}
}
function go_to(pr){
for(var i=0;i<hxs.length;i++){
if(!hxs[i].tmpClass){
hxs[i].tmpClass=hxs[i].className+=" ";
boxsClass[i].tmpClass=boxsClass[i].className+=" ";
}
if(pr==i){
hxs[i].className+=" up"; // 展开状态:标题
boxsClass[i].className+=" up"; // 展开状态:容器
}
else {
hxs[i].className=hxs[i].tmpClass;
boxsClass[i].className=boxsClass[i].tmpClass;
}
}
}
}
tab("tab01","h3","div","","onclick",2); tab("tab02","h4","ol");tab("tab03","h3","div","tab");
//-->
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="Copyright" content="爱JavaScript中文网 http://www.ijavascript.cn/" />
<meta name="description" content="DIV+CSS选项卡" />
<meta content="DIV+CSS选项卡" name="keywords" />
<title>DIV+CSS选项卡演示-爱JavaScript中文网</title><style type="text/css" media="all">
/*TAB布局*/
#tab * {font-size:12px;}
#tab h3 a {display:inline-block;}
#tab h3 a {display:block;}
#tab {position:relative;}
#tab h3,#tab ul,#tab div,#tab li {margin:0;padding:0;list-style-type:none;}
#tab ul li {position:absolute;left:0;top:0;float:left;display:block;width:100px;height:30px;font-size:0;}
#tab ul li#tab2 {left:100px;}
#tab ul li#tab3 {left:200px;}
#tab ul li#tab4 {left:300px;}
#tab ul li div {position:absolute;clear:both;}
#tab ul li div#oDIV2 {left:-100px;}
#tab ul li div#oDIV3 {left:-200px;}
#tab ul li div#oDIV4 {left:-300px;}/*TAB-标题修饰*/
#tab,#tab ul li div,#tab ul li div li {width:450px;}/* 设置总宽度[width] */
#tab {height:200px;background:#ccc;overflow:hidden;}/* 设置总高度[height]、标题背景颜色[background] */
#tab ul li h3 a {height:18px;padding:5px 0 2px;margin:5px 0px 0px 5px;text-align:center;border:solid #ccc 1px;border-bottom:none;color:#333;}/* 标题默认状态 */
#tab ul li h3 a:hover {background-color:#ddd;border-color:#fff;}/* 鼠标经过状态 */
#tab ul li.up h3 a {background:#999;border-color:#fff #999 #999 #fff;color:#fff;}/* 当前窗口状态 */
#tab ul li div {border:solid #999;border-width:1px 0;background:#f7f7f7;height:167px;}/* 设置内容高度[height]、背景颜色[background]、上下分割线[border] */
/*TAB1效果[ol/li]*/
#tab ul li #oDIV1 ol {margin:8px;padding:0;}
#tab ul li #oDIV1 ol li {position:static;float:none;font-size:0;height:auto;}
#tab ul li #oDIV1 ol li a {font-size:12px;display:block;padding:5px 0 1px;}
/*TAB2效果[img]*/
#tab ul li #oDIV2 img {margin:8px;border:none;}
/*TAB3效果[iframe]*/
#tab ul li #oDIV3 iframe {border:none;width:440px;height:157px;margin:5px;}
</style><script type="text/javascript">
<!--
function toggleTo(img)
{
var ts=document.getElementById("tab").getElementsByTagName("div");
for(i=1;i<ts.length+1;i++){
if(img==i)
{
document.getElementById("oDIV"+i).style.display = "";
document.getElementById("oDIV"+i).parentNode.className+=" up";
}
else{
document.getElementById("oDIV"+i).style.display = "none";
document.getElementById("oDIV"+i).parentNode.className="tab"+i;
}
}
}
-->
</script></head><body>
<div id="tab">
<ul>
<li id="tab1" class="up"><h3><a href="####" onclick="javascript:toggleTo(1)">支付</a></h3>
<!-- onclick鼠标释放,onmousemove鼠标经过。 -->
<div id="oDIV1">
<ol>
<li><a href="http://www.ijavascript.cn"><span>使该元素在FireFox下获得高度从而显示背景</span></a></li>
<li><a href="http://www.ijavascript.cn"><span>为了保证浏览器的兼容性</span></a></li>
<li><a href="http://www.ijavascript.cn"><span>文本对齐方式改回默认left</span></a></li>
<li><a href="http://www.ijavascript.cn"><span>左右自适应[FireFox居中方式]</span></a></li>
<li><a href="http://www.ijavascript.cn"><span>内容对齐方式为居中[IE居中方式]</span></a></li>
<li><a href="http://www.ijavascript.cn"><span>内容对齐方式为居中[IE居中方式]</span></a></li>
</ol>
</div>
</li>
<li id="tab2"><h3><a href="####" onclick="javascript:toggleTo(2)">软件下载</a></h3>
<div id="oDIV2" style="display:none;">
<a href="http://www.ijavascript.cn"><img src="http://www.ijavascript.cn/templates/logo/logo.gif" alt="播放软件下载" /></a>
<a href="http://www.ijavascript.cn"><img src="http://www.ijavascript.cn/templates/logo/logo.gif" alt="播放软件下载" /></a></div>
</li>
<li id="tab3"><h3><a href="####" onclick="javascript:toggleTo(3)">问题答疑</a></h3>
<div id="oDIV3" style="display:none;"><iframe frameborder="0" scrolling="auto" src="http://www.ijavascript.cn"></iframe></div>
</li>
<li id="tab4"><h3><a href="####" onclick="javascript:toggleTo(4)">客服</a></h3>
<div id="oDIV4" style="display:none;"><a href="http://www.ijavascript.cn">JavaScript教程网</a></div>
</li>
</ul>
</div>
</body>
</html>