LookupDispathAction使用问题!!!!郁闷,请指点
OS:Win Xp SP2(中文)
开发环境:
1.jdk-6u2-windows-i586-p.exe
2.apache-tomcat-5.5.20.exe
3.eclipse-SDK-3.2-win32.zip
4.MyEclipse.Enterprise.Workbench_5.0.1GA_E3.2.exe
jsp画面要求显示中文,Encoding= "utf-8 ".
jsp写法:
<html:submit styleClass= "button1 " property= "para ">
<bean:message bundle= "display " key= ' <%=ButtonConsts.BTN_LAND%> '/>
</html:submit>
ButtonConsts写法:
public static final String BTN_LAND = "button.land ";
properties写法:
button.land=登录
Action写法:
protected Map getKeyMethodMap() {
Map <String, String> map = new HashMap <String, String> ();
map.put(ButtonConsts.BTN_LAND, "executeLand ");
map.put(ButtonConsts.BTN_RESET, "executeReset ");
return map;
}
运行时:map中的key= "button.land ",value= "executeLand ".
发生以下错误:
javax.servlet.ServletException: Action[/loginDiv] missing resource '登录 ' in key method map
org.apache.struts.actions.LookupDispatchAction.getLookupMapName(LookupDispatchAction.java:240)
org.apache.struts.actions.LookupDispatchAction.getMethodName(LookupDispatchAction.java:281)
org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:158)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
请高手帮忙!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
发生错误的原因是什么,怎样解决!!!!!!!!
------解决方案--------------------应该是中文乱码的问题.
button.land=登录 改为 button.land=Login 测试下!