strut menu 中文乱码
我用struts menu进行配置如下
struts-config.xml
....
<plug-in className= "net.sf.navigator.menu.MenuPlugIn ">
<set-property property= "menuConfig " value= "/WEB-INF/menu-config.xml " />
</plug-in>
.....
menu-config.xml
<?xml version= "1.0 " encoding= "UTF-8 "?>
<MenuConfig>
<Displayers>
<Displayer name= "DropDown " type= "net.sf.navigator.displayer.DropDownMenuDisplayer " />
<Displayer name= "Simple " type= "net.sf.navigator.displayer.SimpleMenuDisplayer " />
<Displayer name= "CoolMenu " type= "net.sf.navigator.displayer.CoolMenuDisplayer " />
<Displayer name= "CoolMenu4 " type= "net.sf.navigator.displayer.CoolMenuDisplayer4 " />
<Displayer name= "MenuForm " type= "net.sf.navigator.example.PermissionsFormMenuDisplayer " />
<Displayer name= "ListMenu " type= "net.sf.navigator.displayer.ListMenuDisplayer " />
<Displayer name= "TabbedMenu " type= "net.sf.navigator.displayer.TabbedMenuDisplayer " />
<Displayer name= "Velocity " type= "net.sf.navigator.displayer.VelocityMenuDisplayer " />
<Displayer name= "XtreeMenu " type= "net.sf.navigator.displayer.XtreeMenuDisplayer " />
<Displayer name= "CSSListMenu " type= "net.sf.navigator.displayer.CSSListMenuDisplayer " />
</Displayers>
<Menus>
<Menu name= "deposit " title= "账户信息 ">
<Item name= "AddDeposit " title= "存款 "
location= "/onlinebank/jsp/tilesForward/ " />
</Menu>
</Menus>
</MenuConfig>
然后我在jsp中使用如下
。。。。
menu:useMenuDisplayer name= "DropDown " bundle= "org.apache.struts.action.MESSAGE ">
<menu:displayMenu name= "deposit " />
。。。。。
可是总出来
???zh_CN.账户信息???
???zh_CN.存款???
???zh_CN.阅读条款???
???zh_CN.申请新账户???
???zh_CN.账户信息???
有些乱码 似乎是properties文件的事 可是我配置时直接用的中文 没有用过message什么的标签之类的
背景还是灰色的 有人知道吗?
我的csdn的第一个问题
sos
------解决方案--------------------你的配置文件的编码是什么?可以用native2ascii工具转一下再用
------解决方案--------------------在eclipse里预览的吧,我预览也是这样,开启服务器在IE里就正常了