Rev 1310 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1310 | Rev 1814 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | import javax.servlet.jsp.tagext.BodyTagSupport; |
6 | import javax.servlet.jsp.tagext.BodyTagSupport; |
7 | import javax.servlet.jsp.JspException; |
7 | import javax.servlet.jsp.JspException; |
8 | import javax.servlet.jsp.JspWriter; |
8 | import javax.servlet.jsp.JspWriter; |
9 | 9 | ||
10 | import pt.estgp.estgweb.domain.*; |
10 | import pt.estgp.estgweb.domain.*; |
- | 11 | import pt.estgp.estgweb.utils.Globals; |
|
11 | 12 | ||
12 | public class CanAddContentTag extends BodyTagSupport |
13 | public class CanAddContentTag extends BodyTagSupport |
13 | { |
14 | { |
14 | 15 | ||
15 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(CanAddContentTag.class); |
16 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(CanAddContentTag.class); |
Line 48... | Line 49... | ||
48 | return SKIP_BODY; |
49 | return SKIP_BODY; |
49 | } |
50 | } |
50 | 51 | ||
51 | public boolean go() throws JspException |
52 | public boolean go() throws JspException |
52 | { |
53 | { |
53 | UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(pt.estgp.estgweb.Globals.USER_SESSION_KEY); |
54 | UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY); |
54 | IAddContents iAddContents = (IAddContents) RequestUtils.lookup(pageContext, name, property, null); |
55 | IAddContents iAddContents = (IAddContents) RequestUtils.lookup(pageContext, name, property, null); |
55 | return iAddContents != null && userSession.getUser() != null && (iAddContents.canAddContent(userSession.getUser())); |
56 | return iAddContents != null && userSession.getUser() != null && (iAddContents.canAddContent(userSession.getUser())); |
56 | } |
57 | } |
57 | 58 | ||
58 | public int doEndTag() throws JspException |
59 | public int doEndTag() throws JspException |