function prepareLoginForm() { var user = document.getElementById("page:j_username"); user.name = "j_username"; var pass = document.getElementById("page:j_password"); pass.name = "j_password"; var form = document.getElementById("page::form"); form.action = "${pageContext.request.contextPath}/j_security_check"; } function fillInGuest() { fillIn("guest"); } function fillInAdmin() { fillIn("admin"); } function fillIn(name) { var user = document.getElementById("page:j_username"); user.value = name; var pass = document.getElementById("page:j_password"); pass.value = name; pass.focus(); }