历史 | 登录     查看当前页的打印版本.  
问题详情 (XML | Word | Printable)

Key: EASYJWEB-29
类型: 改进 改进
状态: Resolved Resolved
解决: Fixed
优先级: Major Major
开发者: daxia
报告人: ian.huang
投票: 0
关注人: 0
操作

复制 问题
创建 子任务
如果你是 登录 你不能看到更多操作.
easyjweb

关于locale

创建: 25/十二月/07 12:01 下午   更新: 26/十二月/07 11:50 上午
模块:
影响版本:
修复版本:


 描述  « Hide
tomat启动时,日志窗口显示信息为:
2007-12-25 01:53:27,265 INFO [com.easyjf.container.impl.DefaultContainer] - 加载了一个容器!com.easyjf.container.impl.SpringContainer@6e8504
2007-12-25 01:53:27,265 INFO [com.easyjf.container.impl.SpringContainer] - 开始Spring容器初始化...
.....

I18n类中默认定义为:
public static String getLocaleMessage(String key) {
return getMessage(key, Locale.getDefault());
}
根据系统默认locale来自动选择显示的信息,但是如果用于调试的话,不太方便查看。
可以修改为:
return getMessage(key,Globals.LANGUAGE);
根据easyjweb默认语言来显示��志信息。
而golobals.java里默认语言设置的地方为:public final static Locale LANGUAGE = new Locale("en", "GB");
这里可以修改成用properties来定义默认语言,否则每次修改需要修改代码和重新编译

 所有   备注   改动记录      排列顺序:
daxia - 26/十二月/07 11:48 上午
已经解决,把I18n中的getLocaleMessage改成了如下的形式:
public static String getLocaleMessage(String key) {
return getMessage(key, Globals.LANGUAGE);
}

并在EasyJWeb的配置文件中增加了一个可以改变系统运行语言的配置属性com.easyjweb.language。现在可以直接在配置文件中设置运行属性。如下:
<easyjf-web>
<framework-setting>
<property name="com.easyjweb.debug">false</property><!--调试模式,每次加载都会重新初始化EasyJWeb-->
<property name="com.easyjweb.language">en</property><!--设置服务器默认语言-->
</framework-setting>
</easyjweb>


daxia - 26/十二月/07 11:50 上午
英文的启动日志如下:
203 [main] INFO com.easyjf.web.config.DefaultWebConfig - Loading Configuration File:classpath:/com/easyjf/web/easyjf-web.xml
312 [main] INFO com.easyjf.web.FrameworkLoader - Ineasyjweb.demoView package and load the default Bean!
406 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.user.service.impl.UserServiceImpl-----NameuserService
406 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.user.dao.impl.UserDaoImpl-----NameuserDao
406 [main] INFO com.easyjf.web.FrameworkLoader - Ineasyjweb.demoView package and load the default Bean!
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.user.mvc.UserAction------Path/user
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.mvc.SimpleUserAction------Path/simpleUser
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.mvc.Simple2User2Action------Path/simple2User2
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.mvc.Simple4UserAction------Path/simple4User
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.mvc.Simple1UserAction------Path/simple1User
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.mvc.Simple3UserAction------Path/simple3User
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.hello.mvc.HelloAction------Path/hello
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.user.mvc.LanguageAction------Path/language
422 [main] INFO com.easyjf.web.FrameworkLoader - Automatic load Beaneasyjweb.demo.wizard.RegisterAction------Path/register
Started containers initialization ....!
953 [main] INFO com.easyjf.web.FrameworkLoader - EasyJWeb initialized!