struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcus (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-2150) Client side validation with theme "xhtml" and i18n message error
Date Fri, 29 Aug 2008 07:01:26 GMT

    [ https://issues.apache.org/struts/browse/WW-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44615#action_44615
] 

Marcus commented on WW-2150:
----------------------------

Hi!  I'm getting this same error with the same symptoms using Struts 2.0.11.2.  I can easily
reproduce it by specifying a message key in my validation.xml file.  What details would you
like me to provide?

> Client side validation with theme "xhtml" and i18n message error
> ----------------------------------------------------------------
>
>                 Key: WW-2150
>                 URL: https://issues.apache.org/struts/browse/WW-2150
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>            Reporter: Vampire Wang
>             Fix For: 2.1.3
>
>
> When I use theme "xhtml" and i18n validation message to run client side validation, I
got the following message on my page:
> FreeMarker template error!
> Method public java.lang.String com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(java.lang.Object)
threw an exception when invoked on com.opensymphony.xwork2.validator.validators.RequiredStringValidator@122d9c
> The problematic instruction:
> ----------
> ==> ${validator.getMessage(action)?js_string} [on line 28, column 26 in template/xhtml/form-close-validate.ftl]
>  in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on line 3, column
1 in template/xhtml/form-close.ftl]
> ----------
> Java backtrace for programmers:
> ----------
> freemarker.template.TemplateModelException: Method public java.lang.String com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(java.lang.Object)
threw an exception when invoked on com.opensymphony.xwork2.validator.validators.RequiredStringValidator@122d9c
> 	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:136)
> 	at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)
> 	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
> 	at freemarker.core.Expression.getStringValue(Expression.java:93)
> 	at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
> 	at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
> 	at freemarker.core.Expression.getStringValue(Expression.java:93)
> 	at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
> 	at freemarker.core.Environment.visit(Environment.java:351)
> 	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160)
> 	at freemarker.core.Environment.visit(Environment.java:351)
> 	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:95)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.Environment.include(Environment.java:1375)
> 	at freemarker.core.Include.accept(Include.java:155)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	at freemarker.core.Environment.visit(Environment.java:196)
> 	at freemarker.core.Environment.process(Environment.java:176)
> 	at freemarker.template.Template.process(Template.java:232)
> 	at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:148)
> 	at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:530)
> 	at org.apache.struts2.components.UIBean.end(UIBean.java:484)
> 	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:43)
> 	at org.apache.jsp.login_jsp._jspx_meth_s_005fform_005f0(login_jsp.java:161)
> 	at org.apache.jsp.login_jsp._jspService(login_jsp.java:79)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at com.vam.book.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:34)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.NullPointerException
> 	at com.opensymphony.xwork2.validator.DelegatingValidatorContext$LoggingValidationAware.<init>(DelegatingValidatorContext.java:234)
> 	at com.opensymphony.xwork2.validator.DelegatingValidatorContext.makeValidationAware(DelegatingValidatorContext.java:193)
> 	at com.opensymphony.xwork2.validator.DelegatingValidatorContext.<init>(DelegatingValidatorContext.java:53)
> 	at com.opensymphony.xwork2.validator.validators.ValidatorSupport.getMessage(ValidatorSupport.java:64)
> 	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)
> 	at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:616)
> 	at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:113)
> 	... 63 more
> ____________________________________
> And if I remove the "key" attribute from my <message> element, everything went
right, it seems that the freemarker couldn't get the text from the *. proterties i18n files.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message