/** * The {@link PasswordInputTag} only writes it's value if the * {@link #setShowPassword(boolean) 'showPassword'} property value is * {@link Boolean#TRUE true}. */ @Override protected void writeValue(TagWriter tagWriter) throws JspException { if (this.showPassword) { super.writeValue(tagWriter); } else { tagWriter.writeAttribute("value", processFieldValue(getName(), "", getType())); } }
/** * https://jira.spring.io/browse/SPR-2866 */ @Test public void passwordValueIsNotRenderedIfShowPasswordAttributeIsSetToFalse() throws Exception { this.getTag().setPath("name"); this.getPasswordTag().setShowPassword(false); assertEquals(Tag.SKIP_BODY, this.getTag().doStartTag()); String output = getOutput(); assertTagOpened(output); assertTagClosed(output); assertContainsAttribute(output, "type", getType()); assertValueAttribute(output, ""); }
@Override protected void assertValueAttribute(String output, String expectedValue) { if (this.getPasswordTag().isShowPassword()) { super.assertValueAttribute(output, expectedValue); } else { super.assertValueAttribute(output, ""); } }
@Override public void doFinally() { super.doFinally(); this.bindStatus = null; }
InputTag passwordInputTag = new PasswordInputTag(); String maximumLength = attributes.get( MAXIMUM_LENGTH );
/** * https://jira.spring.io/browse/SPR-2866 */ @Test public void passwordValueIsRenderedIfShowPasswordAttributeIsSetToTrue() throws Exception { this.getTag().setPath("name"); this.getPasswordTag().setShowPassword(true); assertEquals(Tag.SKIP_BODY, this.getTag().doStartTag()); String output = getOutput(); assertTagOpened(output); assertTagClosed(output); assertContainsAttribute(output, "type", getType()); assertValueAttribute(output, "Rob"); }
/** * The {@link PasswordInputTag} only writes it's value if the * {@link #setShowPassword(boolean) 'showPassword'} property value is * {@link Boolean#TRUE true}. */ @Override protected void writeValue(TagWriter tagWriter) throws JspException { if (this.showPassword) { super.writeValue(tagWriter); } else { tagWriter.writeAttribute("value", processFieldValue(getName(), "", getType())); } }
/** * The {@link PasswordInputTag} only writes it's value if the * {@link #setShowPassword(boolean) 'showPassword'} property value is * {@link Boolean#TRUE true}. */ @Override protected void writeValue(TagWriter tagWriter) throws JspException { if (this.showPassword) { super.writeValue(tagWriter); } else { tagWriter.writeAttribute("value", processFieldValue(getName(), "", getType())); } }