1 16 17 package org.apache.commons.latka.jelly; 18 19 import org.apache.commons.jelly.JellyTagException; 20 import org.apache.commons.jelly.TagSupport; 21 import org.apache.commons.jelly.XMLOutput; 22 23 import org.apache.commons.latka.LatkaException; 24 import org.apache.commons.latka.http.Response; 25 26 30 public class ValidateTag extends TagSupport { 31 32 39 public void doTag(XMLOutput xmlOutput) throws JellyTagException { 40 41 Response response = null; 43 try { 44 response = getResponse(); 45 } catch (LatkaException e) { 46 throw new JellyTagException("could not obtain HTTP response",e); 47 } 48 49 if (response != null) { 52 invokeBody(xmlOutput); 53 } 54 55 } 56 57 protected Response getResponse() throws LatkaException { 58 RequestTag tag = (RequestTag) findAncestorWithClass(RequestTag.class); 59 return tag.getResponse(); 60 } 61 62 } 63 | Popular Tags |