转自:https://blog.51cto.com/stones/389939

 

Struts2国际化异常处理

 

Can't find bundle for base name

Can't find bundle for base name

这是找不到指定文件;

你必须把 .properties 文件,放在与这个调用文件.java 相同的目录里;

Hello.java在workspace\test\src\com\lj\guojiehua下

hello_en_US.properties必须在workspace\test\src下

hello_zh_CN.properties必须在workspace\test\src下


其实原因是我虽然在build path 里面 加了\pruway\source\source\config,但是系统编译的时候,在classes里面应该会自动产生resource_en_US.properties,可是实际情况是classes包下面没有产生,故我删掉重加,再编译结果发现通过了。。

就是说,只要你buildpath路径对了,该路径下也有resoucebudle需要的类,那么系统会自动在classes里面自动编译产生这些类的。所以,先检查classes里,有没有生成对应的resource_en_US.properties,如果没有,那么检查build path 路径下有没有对应的properties类,如果有,那么证明系统编译没有编译完整,删掉path,重新add foler,加入,再编译,检查classes下有无。
如果都有,那么证明成功。


Can't find bundle for base name

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2021-04-03
  • 2021-04-24
  • 2022-12-23
  • 2021-08-31
  • 2022-02-25
  • 2021-10-28
猜你喜欢
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案