我用gb.department_name出现错误
javax.servlet.ServletException: Missing message for key gb.department_name
javax.servlet.ServletException: Missing message for key gb.department_name
解决方案 »
- Java初学者: 关于 java.lang.NullPointerException 异常 的疑惑
- Netbean 界面连接的问题
- Java中如何使用下面正则表达式
- 假如一个字符串中有多个相同的字符,怎样用indexOf()取得指定位置上的字符的位置?
- 提问关于BigDecimal类valueOf()方法的问题
- 请问:table里怎样添加空行???
- 关于Java虚拟机的内存池问题!急!
- 输入汉字,如何得到汉字的拼音?
- 多线程的问题,为什么程序会死调呢?请高手帮忙
- 能具体说说static的用处吗?
- 我照着书学Jbuilder6,可是一样的语句就是有错,那位可以帮我看看
- 高分求救:如何在一个企业的自己的网站上设置搜索引擎,用来搜索本行业的信息,需要什么条件?
如果不在classes根目录下,就要加上包名**.**.ApplicationResources
<struts-config>
<!-- ========== Form Bean Definitions =================================== -->
<form-beans>
<form-bean name="loginform" type="test.LoginForm"/>
<form-bean name="DepartmentLoginFormBean" type="name.huangbo.oa.rlzy.LoginForm"/>
</form-beans>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<action path="/rlzy/DepartmentLogin" type="oa.rlzy.LoginAction" name="DepartmentLoginFormBean" scope="request" validate="false">
<forward name="success" path="/rlzy/success.jsp"/>
<forward name="failed" path="/rlzy/failed.jsp"/>
</action>
</action-mappings>
<message-resources parameter="ApplicationResources"/></struts-config>
我把properties文件放在了classes下,可是启动TOMCAT报解析错误
你在资源文件里用了中文,所以应该把资源文件名改为:ApplicationResources_zh_CN.properties
错误提示是:
parse error at line 27 column 55:Element type "message-resoutces" must be declared
parse error at line 27 column 55:Attribute "parameter" must be declared for element type "message-resoutces"
parse error at line 29 column 17:The content of element type "struts-config" must match "(data-sources?,form-beans?,global-forwards?,action-mappings?)"
parse error at line 27 column 55:Element type "message-resoutces"
^
must be declared
parse error at line 27 column 55:Attribute "parameter" must be declared for element type "message-resoutces"
^
这里的resource写错了!!
可不要这样说struts的坏话。其实,它是很不错的,也不难搞定。只是还不太了解。
不过最近,我也碰到了一个资源文件的问题:
在jsp页面中用<bean:message key="***"/>显示资源文件里的中文时,已经解析出来了,但是非要重新在IE里选一下gb2312才行.若是在页面中加上
<%@ page contentType="text/html;charset=gb2312"%>,结果显示乱码,再在浏览器上怎么选,也出不来汉字了!!!
不行的,我改为message-resoutce也是不行
not struts-config.xml
specify the full qualified class name. it should work
可以在struts-config.xml中的定义的,从struts1.1b1开始就可以了。
to ggzzkk(Blue) :
再好好检查一下吧,要不你就用native2ascii(jdk\bin下的)转一下码。
“我改为message-resoutce也是不行”,应该为:message-resource吧?
对不起,是笔误,我在struts-config.xml里面是message-resource
我用了native2ascii ApplicationResources.properties转换这个文件,但问题还是没有解决啊