|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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:
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 java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Password()
public Password(String name)
name
- The password field namepublic Password(String name, String value)
name
- The password field namevalue
- The initial password valuepublic Password(String name, String value, int size)
name
- The password field namevalue
- The initial password valuesize
- The visible size of the password fieldpublic Password(String name, String value, int size, int len)
name
- The password field namevalue
- The initial password valuesize
- The visible size of the password fieldlen
- The maximum input lengthMethod Detail |
public void write(PrintWriter out) throws IOException
out
- The output stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |