1 package org.sapia.soto.state.cocoon; 2 3 import org.apache.commons.lang.ClassUtils; 4 5 import org.sapia.soto.state.Result; 6 import org.sapia.soto.state.Step; 7 8 9 18 public class ContentTypeStep implements Step { 19 public static final String DEFAULT_CONTENT_TYPE = "text/xml"; 20 private String _contentType = DEFAULT_CONTENT_TYPE; 21 22 25 public void execute(Result st) { 26 ((CocoonContext) st.getContext()).getResponse().setHeader("Content-Type", 27 _contentType); 28 } 29 30 33 public String getName() { 34 return ClassUtils.getShortClassName(getClass()); 35 } 36 37 public void setType(String ct) { 38 _contentType = ct; 39 } 40 } 41 | Popular Tags |