1
14
15 package com.liferay.taglib.util;
16
17 import com.liferay.portal.kernel.util.StringPool;
18 import com.liferay.portal.kernel.util.WebKeys;
19
20 import javax.servlet.http.HttpServletRequest;
21 import javax.servlet.jsp.tagext.BodyTagSupport;
22
23
28 public class HtmlBottomTag extends BodyTagSupport {
29
30 public int doStartTag() {
31 return EVAL_BODY_BUFFERED;
32 }
33
34 public int doAfterBody() {
35 _bodyContentString = getBodyContent().getString();
36
37 return SKIP_BODY;
38 }
39
40 public int doEndTag() {
41 HttpServletRequest request =
42 (HttpServletRequest)pageContext.getRequest();
43
44 StringBuilder sb = (StringBuilder)request.getAttribute(
45 WebKeys.PAGE_BOTTOM);
46
47 if (sb == null) {
48 sb = new StringBuilder();
49
50 request.setAttribute(WebKeys.PAGE_BOTTOM, sb);
51 }
52
53 sb.append(_bodyContentString);
54
55 return EVAL_PAGE;
56 }
57
58 private String _bodyContentString = StringPool.BLANK;
59
60 }