document.getElementById("passwords").focus();
document.getElementById("passwords").select();
<body bgcolor="#FFFFFF" topmargin="0" marginheight="0" leftmargin="0" marginwidth="0" onLoad='<c:if test="${empty param.amt}">focusForm();</c:if><c:if test="${!empty param.amt}">document.getElementById("passwords").focus();document.getElementById("passwords").select();</c:if>'>