KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > kohsuke > stapler > jelly > ContentTypeTag


1 package org.kohsuke.stapler.jelly;
2
3 import org.apache.commons.jelly.JellyTagException;
4 import org.apache.commons.jelly.MissingAttributeException;
5 import org.apache.commons.jelly.XMLOutput;
6
7 /**
8  * Set the HTTP Content-Type header of the page.
9  *
10  * @author Kohsuke Kawaguchi
11  */

12 public class ContentTypeTag extends AbstractStaplerTag {
13     private String JavaDoc contentType;
14
15     /**
16      * The content-type value, such as "text/html".
17      */

18     public void setValue(String JavaDoc contentType) {
19         this.contentType = contentType;
20     }
21
22     public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
23         getResponse().setContentType(contentType);
24     }
25 }
26
Popular Tags