1 27 28 29 package com.sun.ebank.web.template; 30 31 import javax.servlet.jsp.tagext.*; 32 import javax.servlet.jsp.PageContext ; 33 import java.util.*; 34 35 36 public class ParameterTag extends SimpleTagSupport { 37 private String paramName = null; 38 private String paramValue = null; 39 private String isDirectString = null; 40 41 public ParameterTag() { 42 super(); 43 } 44 45 public void setName(String paramName) { 46 this.paramName = paramName; 47 } 48 49 public void setValue(String paramValue) { 50 this.paramValue = paramValue; 51 } 52 53 public void setDirect(String isDirectString) { 54 this.isDirectString = isDirectString; 55 } 56 57 public void doTag() { 58 boolean isDirect = false; 59 60 if ((isDirectString != null) && 61 isDirectString.toLowerCase() 62 .equals("true")) { 63 isDirect = true; 64 } 65 66 try { 67 if (paramName != null) { 69 ArrayList parameters = 70 ((ScreenTag) getParent()).getParameters(); 71 72 if (parameters != null) { 73 Parameter param = 74 new Parameter(paramName, paramValue, isDirect); 75 parameters.add(param); 76 } else { 77 Debug.println("ParameterTag: parameters do not exist."); 78 } 79 } 80 } catch (Exception e) { 81 Debug.println("ParameterTag: error in doTag: " + e); 82 } 83 } 84 } 85 | Popular Tags |