日期:2014-05-17  浏览次数:20736 次

jsp菜初始值问题。。跪求高手~
当我选择了菜单的某项,并单击下一页跳转到的新的页面,菜单的状态又为默认的了。我想保存上次的选择

代码如下,看着有点长,但不难:


<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="com.mes.server.webconsole.model.ClientVersion"%>
<%@ page import="java.io.IOException"%>
<%@ include file="/WEB-INF/pages/commons/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/WEB-INF/pages/commons/meta.jsp"%>

<style type="text/css">
<!--
body {
margin-left: 3px;
margin-top: 0px;
margin-right: 3px;
margin-bottom: 0px;
}

.STYLE1 {
color: #e1e2e3;
font-size: 12px;
}

.STYLE6 {
color: #000000;
font-size: 12;
}

.STYLE10 {
color: #000000;
font-size: 12px;
}

.STYLE19 {
color: #344b50;
font-size: 12px;
}

.STYLE21 {
font-size: 12px;
color: #3b6375;
}

.STYLE22 {
font-size: 12px;
color: #295568;
}

a:link {
text-decoration: none;
}

a:visited {
text-decoration: none;
}

a:hover {
text-decoration: none;
}

a:active {
text-decoration: none;
}
-->
</style>
<script>
var highlightcolor='#d5f4fe';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var clickcolor='#51b2f6';
function changeto(){
source=event.srcElement;
if (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs = source.children;
//alert(cs.length);
if (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor=highlightcolor;
}
}

function changeback(){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor="";
}
}

function clickto(){
source=event.srcElement;
if (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs = source.children;
//alert(cs.length);
if (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
cs[i].style.backgroundColor="";
}
}

function del(path){

if(confirm("确认要卸载此客户端?")){

location.href="${ctx}/console.html?action=clientVersion&method=remove&path=" + path;
}

}

function copy(url){
window.clipboardData.setData('Text','http://'+window.location.host+url);
alert("复制成功");

}

function search(versionName){
location.href="${ctx}/console.html?action=clientVersion&method=list&ver