📄 login.jsp
字号:
<%-- * CyberTester - J2EE Web application for creating, delivering and managing tests/exams/surveys. * Copyright (C) 2003 CyberDemia Research and Services Pty Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); if not, write to the * Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * See the COPYING file located in the top-level-directory of * the archive of this program for complete text of license.--%><%@ page language="java" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %><%@ taglib uri="/WEB-INF/cd_core.tld" prefix="cyberdemia" %><html:html xhtml="true"> <head> <title><fmt:message key="title.login" /></title> <link rel="stylesheet" href="<%= request.getContextPath() %>/cybertester.css" type="text/css" /> <script type="text/javascript" > <!-- function strtrim() { return this.replace(/^\s+/,'').replace(/\s+$/,''); } String.prototype.trim = strtrim; function submitForm() { var theForm = document.getElementById("loginForm"); var userLogin = document.getElementById("loginEmail").value.trim(); var userPassword = document.getElementById("loginPassword").value.trim(); if (userPassword.length>0) { theForm.j_password.value = userPassword; if (userLogin.length>0) { theForm.j_username.value = userLogin.toLowerCase(); if ( theForm.j_username.value.search("^[a-z0-9][a-z0-9._-]*@[a-z0-9._-]*[a-z]$") != -1) { theForm.submit(); } else { alert("<cyberdemia:jsString><fmt:message key="jstext.login.loginForm.error.wrongEmailFormat" /></cyberdemia:jsString>"); } } else { alert("<cyberdemia:jsString><fmt:message key="jstext.login.loginForm.error.missingEmail" /></cyberdemia:jsString>"); } } else { alert("<cyberdemia:jsString><fmt:message key="jstext.login.loginForm.error.missingPassword" /></cyberdemia:jsString>"); } } function trapEnterKey(evt) { var trapKey; if (document.all) { trapKey = String.fromCharCode(window.event.keyCode); } else if (document.getElementById) { trapKey = String.fromCharCode(evt.keyCode); } if (trapKey == "\r" || trapKey == "\n") { submitForm(); } } // --> </script> </head> <body style="text-align:center;"> <div style="text-align:left;"><html:img page="/images/logo.png" alt="CyberTester logo" /></div> <h1><fmt:message key="h1.login" /></h1> <div id="loginBox" style="text-align:center;width:350px;border:1px solid #000055;"> <table width="100%" border="0" > <tr> <td rowspan="2"><html:img page="/images/key_big.gif" alt="Key" /></td> <td><fmt:message key="label.login.loginForm.loginName" /></td> <td><input type="text" id="loginEmail" name="loginEmail" /></td> </tr> <tr> <td><fmt:message key="label.login.loginForm.password" /></td> <td><input type="password" id="loginPassword" name="loginPassword" /></td> </tr> <tr> <td> </td> <td><input type="button" value="Login" onclick="submitForm()" /></td> <td> </td> </tr> </table> </div> <form name="loginForm" id="loginForm" method="POST" action="j_security_check" > <input type="hidden" name="j_username" value="" /> <input type="hidden" name="j_password" value="" /> </form> <script type="text/javascript"> <!-- if (document.captureEvents != null) { document.captureEvents(Event.KEYPRESS); document.onkeypress = trapEnterKey; } //--> </script> </body></html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -