<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@page contentType="text/html;charset=gb2312"%>
<%@ taglib uri="/struts-logic" prefix="logic" %>
<%@ taglib uri="/struts-bean" prefix="bean" %>
<%@ taglib uri="/struts-html" prefix="html" %>
<%@ taglib uri="/jstl/c" prefix="c" %>
<!--初始化，设置一些属性-->
<jsp:useBean id="user" class="com.jspdev.ch17.User" scope="page"/>
<c:set target="${user}" property="userName" value="demouser"/>
<c:set target="${user}" property="age" value="25"/>
<c:set target="${user}" property="password" value="xxxxxx"/>
<c:set var="testProperty" value="testProperty_value" scope="session"/>
<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="<html:rewrite page="/rr.css" />" rel="stylesheet" type="text/css">
<title><bean:message key="title.studyBean"/></title>
</head>
<body>
<center>
<hr>
输出消息：
<bean:message key="global.welcome.cn"/><br/>
输出Property：
<bean:write name="user" property="userName"/><br/>
<bean:define id="userName" type="java.lang.String" property="userName" value="hellking"/>
输出自定义的bean属性：
<bean:write name="userName"/><br/>
把session定义为一个bean：
<bean:page id="mySession" property="session"/><br/>
<bean:write name="mySession"/><br/>
带参数的消息：
<bean:message key="test.param" arg0="1000"/>
</center>
</body>
</html>