Bug 3883 - Undesired pre-fill of fields due to
Summary: Undesired pre-fill of fields due to
Status: CLOSED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Input Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: n/a
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-28 17:33 UTC by chad lafontaine
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chad lafontaine 2001-09-28 17:33:08 UTC
Request 
--------
the ability to 'turn off' pre-filling of text field(s) (or more generally, 
ability to 'turn off' pre-filling for all Input Talib components)

Problem 
--------
the user enters a password in a textfield. If the password is invalid, and the 
user is returned to the JSP page, the password is automatically displayed. What 
if I wanted to turn it off? Even  if I define a default value, any matching 
value in the HttpRequest is picked up before hand. 
 
Lets look at a specific example, located in method 
org.apache.taglibs.input.Text#doStartTag() 

// CURRENT CODE 
/*
 * print out the value from the request if it's there, or
 * use the default value if it's not
 */
if (req.getParameter(name) != null)
    out.print("value=\"" 
        + Util.quote(req.getParameter(name)) + "\" ");
else if (dVal != null)
    out.print("value=\"" + Util.quote(dVal) + "\" ");
else
    out.print("value=\"\" ");

// POSSIBLE SOLUTION  
// with introduction of a boolean attribute e.g., 'prefill'
if (prefill && req.getParameter(name) != null)
    out.print("value=\"" 
        + Util.quote(req.getParameter(name)) + "\" ");
else if (prefill && dVal != null)
    out.print("value=\"" + Util.quote(dVal) + "\" ");
else
    out.print("value=\"\" ");
Comment 1 Shawn Bayern 2001-09-29 06:46:00 UTC
Input fields that do not need to be filled automatically should appear as 
straight HTML tags; auto-fill is the core function of the library.  
<input:password> is specifically not included since this functionality would be 
inappropriate for passwords.