1 package com.opensymphony.webwork.components; 2 3 import com.opensymphony.xwork.util.OgnlValueStack; 4 5 import javax.servlet.http.HttpServletRequest ; 6 import javax.servlet.http.HttpServletResponse ; 7 8 13 public class Label extends UIBean { 14 final public static String TEMPLATE = "label"; 15 16 protected String forAttr; 17 18 public Label(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) { 19 super(stack, request, response); 20 } 21 22 protected String getDefaultTemplate() { 23 return TEMPLATE; 24 } 25 26 protected void evaluateExtraParams() { 27 super.evaluateExtraParams(); 28 29 if (forAttr != null) { 30 addParameter("for", findString(forAttr)); 31 } 32 33 if (value != null) { 35 addParameter("nameValue", findString(value)); 36 } else if (name != null) { 37 String expr = name; 38 if (ALT_SYNTAX) { 39 expr = "%{" + expr + "}"; 40 } 41 42 addParameter("nameValue", findString(expr)); 43 } 44 } 45 46 public void setFor(String forAttr) { 47 this.forAttr = forAttr; 48 } 49 } 50 | Popular Tags |