超链接的target属性使用

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/huzijia888/article/details/78645069
<!doctype html>
<html>
<head>
<!--有序列表使用-->
<style>
ul{
list-style-image:url(xin.jpg);/*使用图片当作列表项制定图标*/
}
</style>
<script>
</script>
<meta charset="UTF-8">
</head>
<body>
<a href="http://www.baidu.com" target="_blank">百度1</a><!--打开一个全新窗口并显示内容-->
<a href="http://www.baidu.com" target="_parent">百度2</a><!--在在上一级的窗口显示内容-->
<a href="http://www.baidu.com" target="_self">百度3</a><!--在原来的窗口显示内容-->
<a href="http://www.baidu.com" target="_top">百度4</a><!--在浏览器的整个窗口显示内容,忽略掉所有的框架结构-->
</body>
</html>
展开阅读全文

struts-menu中target属性使用

01-20

我在frame中使用struts-menu,我在数据库中已经指定了target的属性,但是还是出不来,大家帮忙看一下,我的程序是不是有问题啊?rnrnframe pagernrn<%@ page contentType="text/html;charset=gb2312" language="java"%>rnrnrnrnrn rn rn rn rn rnrnrnrnrnrn数据是用hibernate从数据库中取到的,就是下面程序中的ms.getList()rnrnMenuAction rnrnpublic ActionForward execute(ActionMapping mapping, ActionForm form,rn HttpServletRequest request, HttpServletResponse response) rnrn // TODO Auto-generated method stubrn List list = ms.getList();rnrn if (list.size() < 0)rn return mapping.getInputForward();rn MenuRepository repository = new MenuRepository();rn HttpSession httpsession = (HttpSession) request.getSession();rn ServletContext application = (ServletContext) httpsessionrn .getServletContext();rn MenuRepository defaultRepository = (MenuRepository) applicationrn .getAttribute(MenuRepository.MENU_REPOSITORY_KEY);rn repository.setDisplayers(defaultRepository.getDisplayers());rnrn for (int i = 0; i < list.size(); i++) rn MenuComponent mc = new MenuComponent();rn MenuItem mi = (MenuItem) list.get(i);rn String name = mi.getName();rn mc.setName(name);rn String parent = (String) mi.getParentName();rn //System.out.println(name + ", parent is: " + parent);rn if (parent != null) rn MenuComponent parentMenu = repository.getMenu(parent);rn if (parentMenu == null) rn // System.out.println("parentMenu '" + parentrn // + "' doesn't exist!");rn // create a temporary parentMenurn parentMenu = new MenuComponent();rn parentMenu.setName(parent);rn repository.addMenu(parentMenu);rn rn mc.setParent(parentMenu);rn rn String title = (String) mi.getTitle();rn mc.setTitle(title);rn String location = (String) mi.getLocation();rn mc.setLocation(location);rn String target = (String) mi.getTarget();rn mc.setTarget(target);rnrn repository.addMenu(mc);rnrn rn // request.setAttribute("repository", repository);rn request.getSession().setAttribute("repository", repository);rn return mapping.findForward("ok");rn rnrnrnmenu.jsprnrn rnrn树已经可以出来了,但是就是target无法使用。郁闷啊rn 论坛

没有更多推荐了,返回首页