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* A child of cfservlet. It passes data to the servlet. Each cfservletparam tag within the cfservlet 
026*   block passes a separate piece of data to the servlet.
027*
028*
029*
030**/
031public final class ServletParam extends TagImpl {
032        private String value;
033        private String type;
034        private String variable;
035        private String name;
036
037
038        /**
039        * constructor for the tag class
040         * @throws ExpressionException
041        **/
042        public ServletParam() throws ExpressionException {
043                throw new ExpressionException("tag cfservletparam is deprecated");
044        }
045
046        /** set the value value
047        *  Value of a name-value pair passed to the servlet as a parameter.
048        * @param value value to set
049        **/
050        public void setValue(String value)      {
051                this.value=value;
052        }
053
054        /** set the value type
055        * @param type value to set
056        **/
057        public void setType(String type)        {
058                this.type=type;
059        }
060
061        /** set the value variable
062        * @param variable value to set
063        **/
064        public void setVariable(String variable)        {
065                this.variable=variable;
066        }
067
068        /** set the value name
069        *  If used with the value attribute, it is the name of the servlet parameter. If used with the variable attribute, it is 
070        *               the name of the servlet attribute
071        * @param name value to set
072        **/
073        public void setName(String name)        {
074                this.name=name;
075        }
076
077
078        @Override
079        public int doStartTag() {
080                return SKIP_BODY;
081        }
082
083        @Override
084        public int doEndTag()   {
085                return EVAL_PAGE;
086        }
087
088        @Override
089        public void release()   {
090                super.release();
091                value="";
092                type="";
093                variable="";
094                name="";
095        }
096}