1 package fr.improve.struts.taglib.layout.field; 2 3 import javax.servlet.jsp.JspException ; 4 5 import org.apache.struts.taglib.html.BaseHandlerTag; 6 import org.apache.struts.taglib.html.PasswordTag; 7 11 public class PasswordFieldTag extends AbstractFieldTag { 12 PasswordTag passwordFieldTag = new org.apache.struts.taglib.html.PasswordTag(); 13 protected boolean redisplay = false; 14 protected boolean doBeforeValue() throws javax.servlet.jsp.JspException { 15 fieldTag = passwordFieldTag; 16 return true; 17 } 18 public boolean getRedisplay() { 19 return redisplay; 20 } 21 26 public boolean isRedisplay() { 27 return redisplay; 28 } 29 public void release() { 30 super.release(); 31 redisplay = false; 32 } 33 38 public void setRedisplay(boolean newRedisplay) { 39 redisplay = newRedisplay; 40 } 41 44 protected java.lang.Object getFieldValue() throws JspException { 45 Object lc_value = super.getFieldValue(); 46 switch (getFieldDisplayMode()) { 47 case MODE_EDIT: 48 if (!redisplay) { 49 lc_value = ""; 50 } 51 break; 52 default: 53 lc_value = ""; 54 } 55 return lc_value; 56 } 57 58 protected void copyProperties(BaseHandlerTag in_dest) throws JspException { 59 super.copyProperties(in_dest); 60 passwordFieldTag.setCols(getCols()); 61 passwordFieldTag.setMaxlength(getMaxlength()); 62 passwordFieldTag.setProperty(getProperty()); 63 passwordFieldTag.setRows(getRows()); 64 passwordFieldTag.setValue(getValue()); 65 66 passwordFieldTag.setAccept(getAccept()); 67 passwordFieldTag.setName(getName()); 68 passwordFieldTag.setRedisplay(getRedisplay()); 69 } 70 71 } 72 | Popular Tags |