com.sas.servlet.beans.html
Class Password

java.lang.Object
  |
  +--com.sas.Component
        |
        +--com.sas.servlet.beans.BaseTransformation
              |
              +--com.sas.servlet.beans.BaseInput
                    |
                    +--com.sas.servlet.beans.BaseText
                          |
                          +--com.sas.servlet.beans.BasePassword
                                |
                                +--com.sas.servlet.beans.html.Password

public class Password
extends BasePassword

Transformation bean definition for creating an HTML password entry field. This is very similar to the Text Transformation Bean; the only difference is that all characters entered by the client echo a character like '*'

Problem: Create a document using JSP that contains a password input field.

Solution: Write a Java scriptlet in a JSP page that uses the Password Transformation Bean to create the HTML element.

JSP Page:

 <html>
 <body>
 
 <p> This example shows a simple password field generated by the Password Transformation Bean. </p>
 <FORM>
 <%
    // Create a new password object
    com.sas.servlet.beans.PasswordInterface password = 
       new com.sas.servlet.beans.html.Password(); 

password.setName("password1"); password.setMaximumLength(8); password.write(out); %> </FORM> </body> </html>

HTML output:

 <html>
 <body>
 
 <p> This example shows a simple password field generated by the Password Transformation Bean. </p>
 <FORM>
 <INPUT TYPE=password NAME="password1" MAXLENGTH=8>
 </FORM>
 </body>
 </html>
 

Live element:

See Also:
Serialized Form

Constructor Summary
Password()
          Constructs a new Password Transformation Bean
Password(String name)
          Constructs a new Password Transformation Bean
Password(String name, String value)
          Constructs a new Password Transformation Bean
Password(String name, String value, int size)
          Constructs a new Password Transformation Bean
Password(String name, String value, int size, int len)
          Constructs a new Password Transformation Bean
 
Method Summary
 void write(PrintWriter out)
          Writes the transformed representation of the object
 
Methods inherited from class com.sas.servlet.beans.BaseInput
getMaximumLength, getSize, getText, setMaximumLength, setSize, setText
 
Methods inherited from class com.sas.servlet.beans.BaseTransformation
getCustomAttributes, getDescription, getName, getParent, getRequest, getResponse, setCustomAttributes, setDescription, setName, setParent, setRequest, setResponse, toString, write, write, write
 
Methods inherited from class com.sas.Component
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachModel, attachView, beansIsDesignTime, beansSetDesignTime, clone, clone, detachModel, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getExtendedBeanInfo, getLinkInfo, getModelInterface, getRequiredInterfaces, getResources, getStringResource, getViewInterfaceSupportInfo, initialize, initializeComponent, isDesignTime, isLinked, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setComponentDescription, setComponentSupportInfo, setDefaultValues, setLinkInfo, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, validateObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Password

public Password()
Constructs a new Password Transformation Bean

Password

public Password(String name)
Constructs a new Password Transformation Bean
Parameters:
name - The password field name

Password

public Password(String name,
                String value)
Constructs a new Password Transformation Bean
Parameters:
name - The password field name
value - The initial password value

Password

public Password(String name,
                String value,
                int size)
Constructs a new Password Transformation Bean
Parameters:
name - The password field name
value - The initial password value
size - The visible size of the password field

Password

public Password(String name,
                String value,
                int size,
                int len)
Constructs a new Password Transformation Bean
Parameters:
name - The password field name
value - The initial password value
size - The visible size of the password field
len - The maximum input length
Method Detail

write

public void write(PrintWriter out)
           throws IOException
Writes the transformed representation of the object
Parameters:
out - The output stream
Overrides:
write in class BaseTransformation


Version: 1.2.20000317.001 Formatted: 2000/07/06 15:57:33PM