001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.tag; 020 021 022import java.io.IOException; 023 024import lucee.runtime.PageContextImpl; 025import lucee.runtime.exp.ApplicationException; 026import lucee.runtime.exp.PageException; 027 028public final class HtmlBody extends HtmlHeadBodyBase { 029 030 public String getTagName() { 031 return "htmlbody"; 032 } 033 034 public void actionAppend() throws IOException, ApplicationException { 035 036 ((PageContextImpl) pageContext).getRootOut().appendHTMLBody(text); 037 } 038 039 public void actionWrite() throws IOException, ApplicationException { 040 041 ((PageContextImpl) pageContext).getRootOut().writeHTMLBody(text); 042 } 043 044 public void actionReset() throws IOException { 045 046 ((PageContextImpl) pageContext).getRootOut().resetHTMLBody(); 047 } 048 049 public void actionRead() throws PageException, IOException { 050 051 String str = ((PageContextImpl) pageContext).getRootOut().getHTMLBody(); 052 pageContext.setVariable(variable != null ? variable : "cfhtmlbody", str); 053 } 054 055 public void actionFlush() throws IOException { 056 057 ((PageContextImpl) pageContext).getRootOut().flushHTMLBody(); 058 } 059 060}