Index.jsp
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> 登录 </title>
</head>
<body>
<h1> 欢迎登录 </h1>
<f:view>
<h:form>
<p><h:outputText value="#{UserBean.errMessage}"/></p>
<p> 请输入名字: <h:inputText value="#{UserBean.name}"/></p>
<p> 请输入密码: <h:inputSecret value="#{UserBean.password}"/></p>
<p><h:commandButton value=" 确定 " action="#{UserBean.verify}"/></p>
</h:form>
</f:view>
</body>
</html>
评论4