您的位置:首页 > Web前端 > JavaScript

续分页 jsf组件dataTable

2008-08-05 15:56 507 查看
注册:

<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>
register
</title>
</head>
<body bgcolor="#ffffff">
<f:view>
<h:form>
<h:outputText value="#{regBean.message}">
</h:outputText>
<h:panelGrid columns="3">
<h:outputLabel>
<h:outputText value="用户名:"/>
</h:outputLabel>
<h:inputText id="username" value="#{regBean.username}" required="true">
</h:inputText>
<h:message for="username"/>
<h:outputLabel>
<h:outputText value="密 码:"/>
</h:outputLabel>
<h:inputText id="password" value="#{regBean.userpassword}" required="true">
</h:inputText>
<h:message for="password"/>
<h:outputLabel>
<h:outputText value="密码确认:"/>
</h:outputLabel>
<h:inputText id="password2" value="#{regBean.password2}" required="true">
</h:inputText>
<h:message for="password2"/>
<h:commandButton value="注册" action="#{regBean.doRegister}"/>
<h:commandButton value="重置" type="reset"/>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>

登陆:

<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>
login
</title>
</head>
<body bgcolor="#ffffff">
<f:view>
<h:form>
<h:outputText value="#{LoginBean.message}"/>
<h:panelGrid columns="3">
<h:outputLabel value="用户名:"/>
<h:inputText id="username" value="#{LoginBean.loginname}" required="true"/>
<h:message for="username"/>
<h:outputLabel value="密 码:"/>
<h:inputText id="pwd" value="#{LoginBean.userpassword}" required="true"/>
<h:message for="pwd"/>
<h:commandButton value="登录" action="#{LoginBean.doLogin}">
</h:commandButton>
<h:commandButton value="重置" type="reset">
</h:commandButton>
<h:outputLink value="register.faces">
<f:verbatim> 用户注册 </f:verbatim>
</h:outputLink>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>

退出:

<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>
logout
</title>
</head>
<body bgcolor="#ffffff">
<f:view>
<h:form>
<h:commandButton value="退出登录" action="#{LoginBean.doLogout}">
</h:commandButton>
<h:outputLink value="">
</h:outputLink>
</h:form>
</f:view>
</body>
</html>

删除:

<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>
removeuser
</title>
</head>
<body bgcolor="#ffffff">
<f:view>
<h:form>
<h:inputHidden value="#{removeuserBean.userid}">
</h:inputHidden>
<h:panelGrid columns="2">
<h:outputLabel value="确认要删除#{removeuserBean.username}的用户吗?">
</h:outputLabel>
<h:commandButton value="删除" action="#{removeuserBean.doRemoveuser}">
</h:commandButton>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>

修改:

<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>
userdetail
</title>
</head>
<body bgcolor="#ffffff">
<f:view>
<h:form>
<h:panelGrid columns="3">
<h:inputHidden value="#{updateuserBean.userid}">
</h:inputHidden>
<h:outputLabel value="用户名称:">
</h:outputLabel>
<h:inputText id="username" value="#{updateuserBean.username}">
</h:inputText>
<h:message for="username">
</h:message>
<h:outputLabel value="用户密码:">
</h:outputLabel>
<h:inputText id="userpwd" value="#{updateuserBean.userpassword}">
</h:inputText>
<h:message for="userpwd">
</h:message>
<h:commandButton value="修改" action="#{updateuserBean.doChangeuser}">
</h:commandButton>
</h:panelGrid>
</h:form>
</f:view>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: