你应将application.properties文件中的中文转换为相应的ascii。如
hello.jsp.title=你好 - 这是你的第一个struts 应用
 转换为
hello.jsp.title=\u4f60\u597d - \u8fd9\u662f\u4f60\u7684\u7b2c\u4e00\u4e2astruts
\u5e94\u7528

解决方案 »

  1.   

    cmd: native2ascii application.properties application_zh_CN.properties
      

  2.   

    http://community.csdn.net/Expert/topic/3409/3409848.xml?temp=.3846704我问过的,就用他们的方法!!
      

  3.   

    你将资源文件名改为applicationResources.properties试试
      

  4.   

    最好 将资源文件名改为applicationResources_zh_CN.properties试试
      

  5.   

    修改资源文件要重新启动tomcat吗?
      

  6.   

    放在
    D:\JavaWebStudio\JavaWebStudioWorkDir\helloapp\WEB-INF\classes\hellourl: http://jsp.com/helloapp/server.xml中配置了虚拟站点
    <Host name="jsp.com" debug="0" appBase="D:\JavaWebStudio\JavaWebStudioWorkDir"       
    unpackWARs="true" autoDeploy="true"     
     xmlValidation="false" xmlNamespaceAware="false">       
            <Logger className="org.apache.catalina.logger.FileLogger"
                     directory="logs"  prefix="localhost_log." suffix=".txt"
                timestamp="true"/> 
            <Context path="/helloapp" docBase="helloapp" debug="0" reloadable="true"/>
         <Context path="/" docBase="helloapp" debug="0" reloadable="true"/>
          </Host>已经测试成功
      

  7.   

    struts-config.xml配置如下,跟书本代码一样 
    放在WEB-INF下
    <?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
              "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><!--
         This is the Struts configuration file for the "Hello!" sample application
    --><struts-config>
      
        <!-- ======== Form Bean Definitions =================================== -->
        <form-beans>
            <form-bean name="HelloForm" type="hello.HelloForm"/>
        </form-beans>  <!-- ========== Action Mapping Definitions ============================== -->
      <action-mappings>
        <!-- Say Hello! -->
        <action    path      = "/HelloWorld"
                   type      = "hello.HelloAction"
                   name      = "HelloForm"
                   scope     = "request"
                   validate  = "true"
                   input     = "/hello.jsp"
         >
            <forward name="SayHello" path="/hello.jsp" />
        </action>
      </action-mappings>
        <!-- ========== Message Resources Definitions =========================== -->  <message-resources parameter="hello.application"/></struts-config>
      

  8.   

    好了,原来tomcat不能自己编译类文件,(我以前用的事resin) 要我手动编译,但去出现新的问题,我使用javac编译类文件,发现同一个包找不到其他类??

    test.java 中
    package hello;
    class test{}
    test1.java中
    package hello;
    class test1{
    public void add()
    {
        test t=new test();}
    }
    编译test1.java说找不到test???classpath设置如下:
    .;d:\jdk\libjdk类库可用,但自己写的包却不能用