📄 logged.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.logic;import javax.servlet.jsp.JspException;import javax.servlet.jsp.tagext.TagSupport;import org.butor.profile.IProfile;import org.butor.web.context.IWebContext;import org.butor.web.context.WebContextService;/** * @author sawanai * * Tell if user logged in */public class Logged extends TagSupport { protected String value = null; public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } /** * @see javax.servlet.jsp.tagext.Tag#doStartTag() */ public int doStartTag() throws JspException { if (value == null) { this.value = "true"; } boolean loggedIn = false; IWebContext ctxt = WebContextService.getContext(); if (ctxt != null) { IProfile profile = ctxt.getProfile(); if (profile != null) { loggedIn = true; } } if (this.value.equalsIgnoreCase("true")) { if (loggedIn) { return EVAL_BODY_INCLUDE; } } else { if (!loggedIn) { return EVAL_BODY_INCLUDE; } } return SKIP_BODY; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -