cmu.survey.jsp.tags
Class PasswordQuestion

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by cmu.survey.jsp.tags.TagSupportAndMore
          extended by cmu.survey.jsp.tags.QuestionTagStub
              extended by cmu.survey.jsp.tags.Question
                  extended by cmu.survey.jsp.tags.QuestionWithVariable
                      extended by cmu.survey.jsp.tags.TextQuestion
                          extended by cmu.survey.jsp.tags.PasswordQuestion
All Implemented Interfaces:
HasErrorInfo, HasErrorInfoAndSaves, QuestionTag, java.io.Serializable, java.lang.Cloneable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally

public class PasswordQuestion
extends TextQuestion

A password entry box where the password shows up as "****" instead of text. If you use it like this:
<%@ taglib uri="/WEB-INF/SurveyTags.tld" prefix="survey" %>.
<survey:survey databaseName="<%=databaseName%>" table="tbladmin" >.
    <%survey:passwordQuestion question="Password" dbField="passwordField"/>.
</survey:survey>.
It will show up in the page looking like this:


Password



PasswordQuestions can only be used on fields in the database where the field is of type "string" and the choices you have for the type are "string", "stringKey", "password" or "passwordKey". (For internal security purposes, the "string" and "stringKey" labels are changed to "password" and "passwordKey" -- this is how the server identifies it as a password and checks the value coming in from the client to make sure it's not the default value -- see below as to why this is more secure).

Note: The password is secure only when using a secure certificate and https. The password will not be passed back from the server to the user computer -- instead, it puts in the contents of DefaultPasswordValue, so that a user examining someone else's password page can change it but not see what it is. This also prevents snooping on outgoing server packets from getting passwords.

Note: a good future security feature would be to encrypt these passwords in the database. That change would also need to be made in Survey, which does the comparison to make sure the password is right when the user is entering it to get into the site.

See Also:
Serialized Form

Field Summary
static java.lang.String DefaultPasswordValue
           
 
Fields inherited from class cmu.survey.jsp.tags.TextQuestion
inputType
 
Fields inherited from class cmu.survey.jsp.tags.QuestionWithVariable
dbField, FieldTypeIsKey, FieldTypeIsNumeric, FieldTypes, type
 
Fields inherited from class cmu.survey.jsp.tags.Question
blankImageLocation, endQuestion, helpText, imageDirectory, question
 
Fields inherited from class cmu.survey.jsp.tags.TagSupportAndMore
dateFormatAmerican, dateTimeFormatAmerican, DAYS_OF_THE_WEEK, debug, MONTHS_OF_THE_YEAR, timeFormatAmerican
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
PasswordQuestion()
           
 
Method Summary
 void reinit()
           
 void setType(java.lang.String newType)
           
 
Methods inherited from class cmu.survey.jsp.tags.TextQuestion
doQuestion, hasVariable
 
Methods inherited from class cmu.survey.jsp.tags.QuestionWithVariable
getAnswer, getDbField, getExtraJavaScripts, getExtraJavaScripts, getFieldAndType, getFieldAndType, getTimeSpentInOnClickOrPressed, getTimeSpentInOnClickOrPressed, getType, isTypeKey, isTypeNumeric, isTypeNumeric, isValidType, printTimeSpentField, saveQuestionInfo, setDbField, setDefaultValue
 
Methods inherited from class cmu.survey.jsp.tags.Question
clone, doEndOfQuestion, doEndOfQuestionNoPrinting, doMiddleOfQuestion, doStartOfQuestion, doStartOfQuestion, getAutoSubmitWhenFinishedWithThisQuestion, getBackgroundColorHTMLText, getDatabaseQuery, getEndQuestion, getExtraErrorInfo, getHelpText, getID, getOtherQuestionInfoToSave, getQuestion, getSupplementalErrorInfo, print, print, printTimeSpentField, setAutoSubmitWhenFinishedWithThisQuestion, setBackgroundColor, setEndQuestion, setHelpText, setID, setNumberOfColumns, setOtherQuestionInfoToSave, setQuestion, setSupplementalErrorInfo
 
Methods inherited from class cmu.survey.jsp.tags.QuestionTagStub
doStartTag, getErrorInfo, getSurvey, initSurvey, saveErrorInfo
 
Methods inherited from class cmu.survey.jsp.tags.TagSupportAndMore
breakDownToArray, convertDayNameToNum, convertDayNumToName, convertDayNumToName, convertMonthNumToName, doCatch, doEndTag, doFinally, formatDateTimeViewable, formatDateTimeViewable, formatDateViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, getNumDaysInWeek, parseTimeNoSecondsFromViewable, println
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cmu.survey.jsp.tags.HasErrorInfoAndSaves
saveErrorInfo
 
Methods inherited from interface cmu.survey.jsp.tags.HasErrorInfo
getErrorInfo
 

Field Detail

DefaultPasswordValue

public static final java.lang.String DefaultPasswordValue
See Also:
Constant Field Values
Constructor Detail

PasswordQuestion

public PasswordQuestion()
Method Detail

setType

public void setType(java.lang.String newType)
Overrides:
setType in class QuestionWithVariable

reinit

public void reinit()
Overrides:
reinit in class TextQuestion