breadcrumb.jsp

来自「JSP聊天系统」· JSP 代码 · 共 66 行

JSP
66
字号

<%
/**
 *	$RCSfile: breadcrumb.jsp,v $
 *	$Revision: 1.4 $
 *	$Date: 2000/12/18 02:04:56 $
 */
%>
<%@ page contentType="text/html;charset=gb2312"%>

<%!	///////////////////////
	// breadcrumb variables
	
	// change these values to customize the look of your breadcrumb bar
	
	// Colors
	final static String crumbBgcolor = "#999999";
	final static String crumbFgcolor = "#ccccdd";
%>
<%@ page contentType="text/html;charset=gb2312"%>
<table bgcolor="<%= crumbBgcolor %>" width="100%" border="0" cellspacing="0" cellpadding="1">
<td><table bgcolor="<%= crumbFgcolor %>" width="100%" border="0" cellspacing="0" cellpadding="3">
<td width="99%">
<%	// don't show any breadcrumbs if the breadcrumbs array is null or
	// zero length
	if( breadcrumbs != null && breadcrumbs.length > 0 ) {
		// loop through the breadcrumbs array, only display the first
		// n-1 items (the last one will be displayed as a non-link 
		// because that should represent the page we're on.
		int i=0;
		while( breadcrumbs.length > 1 && i < (breadcrumbs.length-1) ) { 
%>
	<a class="crumb" href="<%= breadcrumbs[i][1] %>"><%= breadcrumbs[i][0] %></a>
	&nbsp;&gt;&nbsp;
<%			i++;
		}
		if( breadcrumbs.length >= 1 ) {
%>
	<%= breadcrumbs[i][0] %>
	
<%	// end of while loop
	}
%>
</td>
<%	// grab the username to display who we are logged in as. If the
	// authentication token is null, that means a guest is viewing the page,
	// so display "guest" instead of a username:
	
	boolean loggedIn = authToken != null && !user.isAnonymous();
	String username = "<i>游客</i>";
	if( loggedIn ) {
		username = user.getUsername();
	}
%>
          <td width="1%" nowrap> 
            <%	if( loggedIn ) { %>
            已登录:<%= username %> 
            <%	} else { %>
            <i>未登录。<a href="login.jsp">登录或注册新用户.</a></i> 
            <%	} %>
          </td>
</table></td></table>

<%	} %>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?