jsp控制导航栏目显亮

导航的单独文件nav.jsp

<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@taglib prefix=
"c"  uri="http://java.sun.com/jsp/jstl/core" %>
<div id=
"navbox">
<ul>
<c:choose>
<c:when test=
"${param.view=='nav1'}"><font color=red>导航一</font></c:when>
<c:otherwise>导航一</c:otherwise>
</c:choose>

<c:choose>
<c:when test=
"${param.view=='nav2'}"><font color=red>导航二</font></c:when>
<c:otherwise>导航二</c:otherwise>
</c:choose>
</ul>
  </div>

调用导航的文件show.jsp

<%@ page language=
"java"  pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'show.jsp' starting page</title>
  </head>
  
  <body>
    <jsp:include page=
"/nav.jsp">
<jsp:param name=
"view" value="nav1"/>
</jsp:include>
  </body>
</html>


效果:
lunzi   2008-11-11 11:12:40 评论:0   阅读:1689   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog