创建资料文件,配置struts-config 文件,
jsp使用标签
<bean:message key=jsp.hello />

解决方案 »

  1.   

    欢迎光临http://www.nocoer.com网站!一个web开发人员汇集的地方,每天都有精彩的技术贴子和文章!欢迎大家讨论!
    每天都会有大量的供求信息发布!要做兼职的可以上来看看
    noco赌场!可以在这里赚取大量的cp点数
    noco考场!可以在这里证明你的开发能力
    noco道具市场!购买你需要的道具!让noco更有意思
    noco精灵市场!购买精灵为你作战!
    noco = note + code + er 
      

  2.   

    ?
    在你的property里面写上中文。然后用ant的native2ascii将property文件转换一下,就行了。
      

  3.   

    建议阅读一下struts中关于资源文件的章节
    一般的中文property文件,需要用native2ascii转换一下,native2ascii是在你jdk的bin中,你可以直接用dos命令进行转换
      

  4.   

    没用过native2ascii,请问如何使用该命令?
      

  5.   

    如果你不做国际化就直接修改struts原码吧struts.jarorg.apache.struts.util.ResponseUtils
    找到public static void write(PageContext pageContext, String text)
            throws JspException
        {
            JspWriter writer = pageContext.getOut();
            try
            {
    --------------------------------------------------------------------------------------
                if(text != null)
                {
                    text = new String(text.getBytes("8859_1"), "gb2312");   加上这些代码
                }
    -----------------------------------------------------------------------------------------
                writer.print(text);
            }
            catch(IOException e)
            {
                RequestUtils.saveException(pageContext, e);
                throw new JspException(messages.getMessage("write.io", e.toString()));
            }
        }    public static void writePrevious(PageContext pageContext, String text)
            throws JspException
        {
            JspWriter writer = pageContext.getOut();
            if(writer instanceof BodyContent)
            {
                writer = ((BodyContent)writer).getEnclosingWriter();
            }
            try
            {
    --------------------------------------------------------------------------------------
                if(text != null)
                {
                    text = new String(text.getBytes("8859_1"), "gb2312");   加上这些代码
                }
    --------------------------------------------------------------------------------------
                writer.print(text);
            }
            catch(IOException e)
            {
                RequestUtils.saveException(pageContext, e);
                throw new JspException(messages.getMessage("write.io", e.toString()));
            }
        }
    这样就OK了<%@ page contentType="text/html; charset=gb2312" language="java" %>
    要用gb2312