001    package railo.runtime.tag;
002    
003    import railo.runtime.exp.PageException;
004    import railo.runtime.ext.tag.TagImpl;
005    import railo.runtime.op.Caster;
006    
007    /**
008    * Used to: Abort the processing of the currently executing CFML custom tag, exit the template 
009    *   within the currently executing CFML custom tag and reexecute a section of code within the currently
010    *   executing CFML custom tag
011    *
012    **/
013    public final class Forward extends TagImpl {
014    
015        private String template;
016        
017        /**
018         * @param template The template to set.
019         */
020        public void setTemplate(String template) {
021            this.template = template;
022        }
023    
024        @Override
025        public int doStartTag() throws PageException {
026            try {
027                            pageContext.forward(template);
028                    } 
029            catch (Exception e) {
030                throw Caster.toPageException(e);
031                    } 
032                    
033            /*RequestDispatcher disp = pageContext. getHttpServletRequest().getRequestDispatcher(template);
034            try {
035                disp.forward(pageContext. getHttpServletRequest(),pageContext. getHttpServletResponse());
036            } 
037            catch (Exception e) {
038                throw Caster.toPageException(e);
039            }*/
040            return SKIP_BODY;
041        }
042    
043    
044    }