struts-menu中的target解决.

在项目中碰到的那个struts-menu的target问题,折腾了好长时间,现在终于解决了.

跟大家分享一下.

修改struts-menu源码中的:     DisplayerStrings.properties   然后编译就行了.

 

#starts the top level of the menu
dd.menu.top=<table width/="150" style/="background-color/:lightgrey" cellpadding/=1 cellspacing/=1><tr align/=left><td nowrap class/=normal><b>
dd.menu.bottom=</td></tr></table>
dd.image.src.expand=/public/resources/menu/images/Rarrow.gif
dd.link.start=<a href/="{0}" target/="{1}" title/="{2}" style/="text-decoration/:none;font-family/:Helvetica,Arial;font-size/:12px">
dd.link.end=</a>
dd.js.toggle.display=   function toggleMenuDisplay(menu, img) {0}/n  var cookieName /= "menu-" + menu.id;/n  if (menu.style.display /=/= 'none') {0}/n    menu.style.display/='block';/n    img.src /= imgSrcExpanded;/n    setCookie(cookieName,'block');  /n  {1} else{0}/n    menu.style.display/='none';/n    img.src /= imgSrcExpand;/n    setCookie(cookieName,'none');  {1}/n{1}
dd.js.start=/n<script type/="text/javascript">/n
dd.js.end=/n</script>
#area on the document that toggles the display of the associated menu
dd.menu.expander=<label style/="cursor/:hand;font-family/:verdana;font-size/:12px;font-weight/:bold" onmouseover/="this.style.color/='red'" onmouseout/="this.style.color/='black'" onclick/="toggleMenuDisplay(document.getElementById('{0}'), document.getElementById('{1}'))"> {2} </label>
dd.menu.restricted=<label style/="cursor/:hand;font-family/:verdana;font-size/:12px;font-weight/:bold" onmouseover/="this.style.color/='red'" onmouseout/="this.style.color/='black'" onclick/="return false"> {2} </label>
dd.menu.restore=<script type="text/javascript">/n  var redisplay /= getCookie('menu-{0}');/n  if (redisplay /=/= 'block')/n  toggleMenuDisplay(document.getElementById('{0}'), document.getElementById('{1}'), false);/n</script>

#starts a menu item
dd.menu.item.top=<div id/="{0}" style/="display/:none">/n<table cellpadding/="0" cellspacing/="0">/n
dd.menu.item.bottom=</table></div>
dd.menu.item.row.start=<tr><td>&nbsp;&nbsp;
dd.menu.item.row.end=</td></tr>
dd.image=<img src/="{0}" style/="border: 0" />
dd.image.src.expanded=/public/resources/menu/images/Darrow.gif
dd.image.expander=<img id/="{0}" src/="{1}" style/="border: 0" />
dd.js.image.src.expand=  var imgSrcExpand /= "{0}";/n
dd.js.image.src.expanded=  var imgSrcExpanded /= "{0}";/n
smd.style=<style type="text/css">/n  .smd-menu-top {0}font-family:verdana,arial;font-size:12px;font-weight:bold{1}/n  .smd-menu-item {0}font-family:verdana,arial;font-size:12px;{1}/n  img.smd-menu {0}border: 0{1}/n  a.smd-menu {0}text-decoration:none{1}/n</style>
smd.menu.top=<table cellpadding/="0" cellspacing/="1">/n
smd.menu.bottom=</table>/n
smd.menu.item.top=<tr><td class/="smd-menu-top">{0}</td></tr>/n
smd.menu.item=<tr><td class/="smd-menu-item"><a href/="{0}" class/="smd-menu" target/="{1}" title/="{2}">{3}</a></td></tr>/n
smd.menu.item.image=<img src/="{0}" class/="smd-menu"/>&nbsp;
smd.menu.item.image.bullet=


#TODO: add /n and /t's to make it look prettier and mouse event handlers
lmd.js.start=/n<script type="text/javascript">/n<!--/n/twindow.onload = function() {/n
lmd.js=/t/tinitializeMenu("{0}", "{1}");/n
lmd.js.expand=/t/texpandMenus();/n
lmd.js.stop=/t}/n//-->/n</script>
lmd.begin=<ul {0}class="menuList">/n
lmd.end=</ul>
lmd.menu.top=/t<li class="menubar">/n
lmd.menu.bottom=/t</li>/n
lmd.menu.actuator.link=/t<a href="#" id="{0}Actuator" class="actuator">&nbsp;</a><a href="{3}" title="{1}" target ="right" class="base">{1}</a>/n/t/t<ul id="{0}Menu" class="{2}">/n
lmd.menu.actuator.top=/t<a href="#" id="{0}Actuator" class="actuator">{1}</a>/n/t/t<ul id="{0}Menu" class="{2}">/n
lmd.menu.actuator.bottom=/t/t</ul>/n/t</li>/n
lmd.menu.item=/t<li><a href="{0}" title="{1}"{2}>{3}</a></li>
lmd.menu.standalone=/t<a href="{0}" title="{1}" class="standalone"{2}>{3}</a>

#coolmenus HTML
cm.image=<img src/="{0}" style/="/:none" />

#tabbedmenu HTML
tmd.menu.tab=<a href="{0}" title="{1}"{2}>{3}</a>/n/t<ul class="submenu">/n
tmd.menu.item=/t<li><a href="{0}" title="{1}"{2}>{3}</a></li>

# css list menu
ccslm.menu.top=/t<li{0}>/n
ccslm.menubar.top=/t<a href="{0}"{1}>{2}</a>/n

 

红色部分为增加部分,你自已可以设置该target值,设置成自已想将struts-menu中的菜单点开后,需要在哪个frame中展开. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值