---
title: "struts资源文件的中文解决方法，附带Struts1.2动态FormBean加验证功能的一个例子"
author: "iammonster"
date: "2007-11-25T11:03:00Z"
tags: []
slug: "struts-struts1-2-formbean"
draft: false
lastmod: "2007-11-25T11:03:00Z"
id: 273284
url: "https://jiajun.iteye.com/blog/273284"
---

1、 在资源文件的目录下建立一个批处理文件，例如我的目录是：

E:\\workspaceSpring\\StrutsProject\\WebRoot\\WEB-INF\\classes\\com\\icespar\\struts

那么就在这个目录下建立一个批处理文件(toChinese.bat)，内容如下：

native2ascii -encoding gb2312 ApplicationResources.properties ApplicationResources\_zh.properties  

2、在struts-config.xml文件中修改资源文件的配置

&lt;message-resources parameter="com.icespar.struts.ApplicationResources" /&gt;

换成：

&lt;message-resources parameter="com.icespar.struts.ApplicationResources\_zh" /&gt;

3、发布之前，双击批处理文件

4、OK，解决。

 

另外， 在我的资源里面有 “Struts1.2动态FormBean加验证功能的一个例子”，可以下载。