81,090
社区成员
发帖
与我相关
我的任务
分享
java.lang.NullPointerException
at com.opensymphony.xwork2.util.LocalizedTextUtil.createMissesKey(LocalizedTextUtil.java:240)
at com.opensymphony.xwork2.util.LocalizedTextUtil.findResourceBundle(LocalizedTextUtil.java:219)
at com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTextUtil.java:604)
at com.opensymphony.xwork2.util.LocalizedTextUtil.findMessage(LocalizedTextUtil.java:645)
at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:360)
at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:293)
at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:173)
at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:88)
at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:71)
at com.eu3c.struts.account.LoginAction.execute(LoginAction.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)……
addFieldError("属性", this.getText("资源文件中的key",new String[]{"参数"}));
没有参数的话直接写key。
<constant name="struts.devMode" value="true"></constant>
<constant name="struts.enable.DynamicMethodInvocation" value="true"></constant>
<constant name="struts.objectFactory" value="spring"></constant>
<constant name="struts.custom.il8n.resources" value="com.test.struts.ApplicationResources"></constant>
<constant name="struts.il8n.encoding" value="UTF-8"></constant>
<constant name="struts.il8n.reload" value="true"></constant>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
alert(navigator.userLanguage || navigator.language);
</script>
</head>
<body>
</body>
</html>
getText重名了吧。 或者说你没有定义text 的get set 方法吧。不行的话 你把你的
代码 粘出来 瞅瞅。