📄 showusername.java
字号:
/* * 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -