1 /*
2 * LabelTag.java
3 *
4 * $Author: mballesteros $ $Date: 2004/01/28 11:56:07 $ $Revision: 1.2 $
5 */
6 package net.sf.ewc.taglib;
7
8 import java.io.IOException;
9
10 import javax.servlet.jsp.JspException;
11 import javax.servlet.jsp.JspWriter;
12
13 /***
14 * {@link LabelTag}evaluates the source expression and prints out its result
15 *
16 * @author mballesteros
17 */
18 public class LabelTag extends EWCTag {
19
20 private String src;
21
22 /***
23 * Sets the expression to evaluate
24 *
25 * @param src
26 */
27 public void setSrc(String src) {
28 this.src = src;
29 }
30
31 /***
32 * Main constructor
33 */
34 public LabelTag() {
35 super();
36 }
37
38 /***
39 * Returns the next processing action, that will be {@link #SKIP_BODY}
40 *
41 * @return The next processing action, that will be {@link #SKIP_BODY}
42 * @throws JspException
43 */
44 public int doStartTag() throws JspException {
45 JspWriter out = pageContext.getOut();
46 try {
47 out.print(getExpressionValueAsString(src));
48 } catch (IOException e) {
49 e.printStackTrace();
50 }
51 return SKIP_BODY;
52 }
53 }
This page was automatically generated by Maven