Please ask this question on the struts-user list; the struts-dev list is for the development of Struts itself.
Thanks, Dave --- On Tue, 10/28/08, Tim <[EMAIL PROTECTED]> wrote: > I have some errors while validating my form. > > [b]struts.xml[/b] > <package name="view" > extends="struts-portlet-default" > namespace="/view"> > > <action > name="AddClientRequestAction_*" > method="{1}" > class="autopay.portlet.action.AddClientRequestAction"> > <result > name="input">/WEB-INF/jsp/view/addRequest.jsp</result> > <result > name="source">/WEB-INF/jsp/view/addRequest.jsp</result> > > <result>/WEB-INF/jsp/view/ok.jsp</result> > </action> > </package> > > [b]AddClientRequestAction[/b] > > public class AddClientRequestAction extends ActionSupport { > private String a = "aaaaaaaaaaaaa"; > > @Override > public String execute() throws Exception { > System.out.println("a: " + a); > > > if (isInvalid(a)) return INPUT; > addActionMessage("my action message"); > return SUCCESS; > } > > public String getA() { > return a; > } > > public void setA(String a) { > this.a = a; > } > > public void validate() { > System.out.println("AddClientRequestAction - > VALIDATE!!!"); > super.validate(); > } > > private boolean isInvalid(String value) { > return (value == null || value.length() == 0); > } > } > > [b]Exception[/b] > > 2008-10-27 18:56:52,452 ERROR > [org.jboss.portal.core.model.portal.control.page.DefaultPageControlPolicy] > Rendering portlet window produced an error > javax.portlet.PortletException: Error executing action > renderDirect.... > > Caused by: javax.portlet.PortletException: > org.apache.jasper.JasperException: > java.lang.NullPointerException > at > org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:91) > ... > [b]interesting part[/b] > > Caused by: java.lang.NullPointerException > at > java.text.MessageFormat.applyPattern(MessageFormat.java:422) > at > java.text.MessageFormat.<init>(MessageFormat.java:350) > at > com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:70) > at > com.opensymphony.xwork2.DefaultTextProvider.getText(DefaultTextProvider.java:111) > at > org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:62) > at > org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:105) > at > org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:631) > at > org.apache.struts2.components.UIBean.end(UIBean.java:509) > at > org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42) > at > org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspx_meth_s_005ftextfield_005f0(addRequest_jsp.java:200) > at > org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspx_meth_s_005fform_005f0(addRequest_jsp.java:132) > at > org.apache.jsp.WEB_002dINF.jsp.view.addRequest_jsp._jspService(addRequest_jsp.java:73) > > [b]Extract from line 422 of MessageFormat.java as it is in > Java 1.6.0_07:[/b] > > for (int i = 0; i < pattern.length(); ++i) { > > It seems that, struts 2 validator can't find message > patterns. But i tried a great numbers of message mapping, > and with out localized messages only > addErrorMessage("error") method. > > Could anyone help me with this error? > Thanks. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.opensymphony.com/thread.jspa?threadID=497651&messageID=587399#587399 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]