struts2国际化文件不起作用 怎么办
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.custom.il8n.resource" value="messageResource"></constant>
<package name="struts2" extends="struts-default">
<action name="login" class="com.javaweb.ch15.LoginAction3">
<result name="success">/Register_success.jsp</result>
<result name="error">/Register_failure.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
login.title=30331 24405
login.username=29992 25143 21517
login.password=23494 30721
messageResource_zh_CN.properties文件内容
<%@ page language="java" pageEncoding="gb2312"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title><s:text name="login.title"></s:text></title>
</head>
<body>
<s:form action="login">
<s:textfield name="uname" key="login.username"></s:textfield>
<s:password name="upw" key="login.password"></s:password>
<s:submit value="提交"></s:submit>
<s:reset value="重置"></s:reset>
</s:form>
</body>
</html>
问题解决了!我也不知道怎么就好了!不过谢谢大家的热心回答! 展开
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.custom.il8n.resource" value="messageResource"></constant>
<package name="struts2" extends="struts-default">
<action name="login" class="com.javaweb.ch15.LoginAction3">
<result name="success">/Register_success.jsp</result>
<result name="error">/Register_failure.jsp</result>
<result name="input">/Login.jsp</result>
</action>
</package>
</struts>
login.title=30331 24405
login.username=29992 25143 21517
login.password=23494 30721
messageResource_zh_CN.properties文件内容
<%@ page language="java" pageEncoding="gb2312"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title><s:text name="login.title"></s:text></title>
</head>
<body>
<s:form action="login">
<s:textfield name="uname" key="login.username"></s:textfield>
<s:password name="upw" key="login.password"></s:password>
<s:submit value="提交"></s:submit>
<s:reset value="重置"></s:reset>
</s:form>
</body>
</html>
问题解决了!我也不知道怎么就好了!不过谢谢大家的热心回答! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询