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

JSF学习三 在上个项目上加一个返回按钮

2014-10-16 13:28 253 查看
只需要在welcome.xhtml页面上加个按钮就可以了。

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<body>

<h:outputText value="#{user.name}"></h:outputText>您好!
<h1>欢迎使用JavaServer Faces !</h1>
<strong style="background-color: rgb(255, 0, 0);"><h:commandButton value="返回" onclick="history.go(-1)"></h:commandButton></strong>
</body>
</html>


效果如下图所示:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jsf2 按钮 返回
相关文章推荐