struts.xml
<constant name="struts.custom.i18n.resources" value="RegisterAction" />
register.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><s:text name="title"/></title>
</head>
<body bgcolor="#9966FF"><div align="center">
<label>
<strong><font size="+5"><font color="#FF0066"><s:text name="upside"/></font></font></strong><br/>
</label>
<s:form method="post" action="registerAction" id="registerForm" theme="simple">
<table border="0" >
<tr>
<td><s:text name="user.username"/>:</td>
<td><s:textfield name="user.username" /></td>
</tr>
<tr>
<td><s:text name="user.password"/>:</td>
<td><s:password name="user.password" /></td>
</tr>
<tr>
<td><s:text name="user.repassword"/>:</td>
<td><s:password name="user.repassword" /></td>
</tr>
<tr>
<td><s:text name="user.age"/>:</td>
<td><s:textfield name="user.age" /></td>
</tr>
<tr>
<td><s:text name="user.email"/>:</td>
<td><s:textfield name="user.email" /></td>
</tr>
<tr>
<td><s:text name="user.date"/>:</td>
<td><s:textfield name="user.date" /></td>
</tr>
<tr>
<td><s:submit key="submit"/></td>
<td><s:reset key="reset"/></td>
</tr>
</table>
</s:form>
<s:fielderror cssStyle="color:red;">
<s:actionerror cssStyle="color:red;" />
</s:fielderror>
</div>
</body>
</html>
RegisterAction_en_US.properties
user.username=username
user.password=password
user.age=age
user.email=email
user.repassword=repassword
submit=submit
reset=reset
title=register
user.date=date
upside=shoppingregister
RegisterAction_zh_CN.properties
user.username=\u7528\u6237\u540D
user.password=\u5BC6 \u7801
user.email=\u90AE\u7BB1
user.repassword=\u91CD\u590D\u5BC6\u7801
title=\u6CE8\u518C
upside=\u7F51\u4E0A\u5546\u5E97\u6CE8\u518C
user.age=\u5E74\u9F84
user.date=\u51FA\u751F\u65E5\u671F
submit=\u6CE8\u518C
reset=\u91CD\u7F6E
浏览器->工具->Intnet选项->语言 选英文
输入http://pc0317roa:8080/Struts2ShiXun/register.jsp
用户名: | |
密 码: | |
重复密码: | |
年龄: | |
邮箱: | |
出生日期: | |
username: | |
password: | |
repassword: | |
age: | |
email: | |
date: | |