你应将application.properties文件中的中文转换为相应的ascii。如
hello.jsp.title=你好 - 这是你的第一个struts 应用
转换为
hello.jsp.title=\u4f60\u597d - \u8fd9\u662f\u4f60\u7684\u7b2c\u4e00\u4e2astruts
\u5e94\u7528
hello.jsp.title=你好 - 这是你的第一个struts 应用
转换为
hello.jsp.title=\u4f60\u597d - \u8fd9\u662f\u4f60\u7684\u7b2c\u4e00\u4e2astruts
\u5e94\u7528
解决方案 »
- 关于spring和ServletContextListener
- 在struts内写一段代码发现问题了
- J2EE常用工具类—文件打包解包处理类
- 大家抽点空帮帮我 谢谢
- 初次使用无状态sessionbean的问题
- 有关jbosscmp-jdbc.xml的问题,很简单
- 各位,请帮我想想办法吧!!我实在是想不出了,谢谢大家了,解决问题立即给分!
- ejb的部署问题
- ajax+json+jquery的小项目放在struts2里就可以,为什么放在spring里就不行?
- ISO/IEC 7064 MOD37-2 校验
- java里面如何定义一个类的属性?
- 请问在hibernate中能否获得java.sql.Connection对象?
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>已经测试成功
放在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>
如
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类库可用,但自己写的包却不能用