📄 register.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSF 'register.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<script type="text/javascript">
function checkPWD(){
var password= document.getElementById("password");//获取不了,为null
var rpassword= document.getElementById("rpassword");//获取不了,为null
if(password==rpassword){
return true;
}else{
return false;
}
}
</script>
<body>
<f:view>
<h:form onsubmit="return checkPWD()">
<h:outputLabel for="userName" value="用户名:" />
<h:inputText id="userName" value="#{userBean.username}" required="true" />
<h:message for="userName" />
<h:outputLabel for="password" value="密码:" />
<h:inputText id="password" value="#{userBean.userpwd}" required="true" />
<h:message for="password" />
<h:outputLabel for="rpassword" value="确认密码:" />
<h:inputText id="rpassword" required="true" />
<h:message for="rpassword" />
<h:commandButton value="提交" action="#{userBean.register}" />
</h:form>
</f:view>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -