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 021import lucee.runtime.exp.ExpressionException; 022import lucee.runtime.ext.tag.TagImpl; 023 024/** 025* Executes a Java servlet on a JRun engine. This tag is used in conjunction with the 026* cfserletparam tag, which passes data to the servlet. 027* 028* 029* 030**/ 031public final class Servlet extends TagImpl { 032 033 private boolean debug; 034 private String code; 035 private boolean writeoutput; 036 private double timeout; 037 private String jrunproxy; 038 039 040 /** 041 * constructor for the tag class 042 * @throws ExpressionException 043 **/ 044 public Servlet() throws ExpressionException { 045 throw new ExpressionException("tag cfservlet is deprecated"); 046 } 047 048 /** set the value debug 049 * Boolean specifying whether additional information about the JRun connection status and 050 * activity is to be written to the JRun error log 051 * @param debug value to set 052 **/ 053 public void setDebug(boolean debug) { 054 this.debug=debug; 055 } 056 057 /** set the value code 058 * The class name of the Java servlet to execute. 059 * @param code value to set 060 **/ 061 public void setCode(String code) { 062 this.code=code; 063 } 064 065 /** set the value writeoutput 066 * @param writeoutput value to set 067 **/ 068 public void setWriteoutput(boolean writeoutput) { 069 this.writeoutput=writeoutput; 070 } 071 072 /** set the value timeout 073 * Specifies how many seconds JRun waits for the servlet to complete before timing out. 074 * @param timeout value to set 075 **/ 076 public void setTimeout(double timeout) { 077 this.timeout=timeout; 078 } 079 080 /** set the value jrunproxy 081 * @param jrunproxy value to set 082 **/ 083 public void setJrunproxy(String jrunproxy) { 084 this.jrunproxy=jrunproxy; 085 } 086 087 088 @Override 089 public int doStartTag() { 090 return SKIP_BODY; 091 } 092 093 @Override 094 public int doEndTag() { 095 return EVAL_PAGE; 096 } 097 098 @Override 099 public void release() { 100 super.release(); 101 debug=false; 102 code=""; 103 writeoutput=false; 104 timeout=0d; 105 jrunproxy=""; 106 } 107}