MyEclipse_struts_硬编码

asdujiayong 2009-08-04 05:01:31
我在测试struts硬编码的时候,用MyEclipse做的:
1.将struts所需的jar包拷贝到lib下
2 在struts-config.xml 加入 <message-resources parameter="ApplicationResource"/>
3源包下提供了ApplicationResource.properties ApplicationResource_zh_CN.properties 俩个文件,并且中文已经转换成了ascii码了
然后在jsp页面里,用<bean:message key="index.username"/><br>读取资源文件
运行的时候抛出NullPointerException
java.lang.NullPointerException
org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1175)
org.apache.struts.taglib.TagUtils.message(TagUtils.java:1038)
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:224)
org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:96)
org.apache.jsp.index_jsp._jspService(index_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)



但是用同样的方法在netbeans里是可以读出的,
请问在Eclipse中这样做成吗?
...全文
55 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhang_yu_QIN 2009-08-06
  • 打赏
  • 举报
回复
顶//
  • 打赏
  • 举报
回复
bean在struts-config.xml里没配置

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧