showusername.java

来自「一个实用工具类」· Java 代码 · 共 42 行

JAVA
42
字号
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file.  */package org.butor.web.taglib.utils;import javax.servlet.jsp.JspException;import javax.servlet.jsp.tagext.TagSupport;import org.apache.struts.util.ResponseUtils;import org.butor.profile.IProfile;import org.butor.web.context.IWebContext;import org.butor.web.context.WebContextService;/** * @author sawanai * * show logged username */public class ShowUsername extends TagSupport {	/**	 * @see javax.servlet.jsp.tagext.Tag#doStartTag()	 */	public int doStartTag() throws JspException {				IWebContext ctxt = WebContextService.getContext();		if (ctxt != null) {			IProfile profile = ctxt.getProfile();			if (profile != null) {				ResponseUtils.write(pageContext, profile.getProperty("username"));			}		}		return SKIP_BODY;	}}

⌨️ 快捷键说明

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