struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john lee <sh_thorn_b...@yahoo.com>
Subject struts 2 validation error
Date Thu, 07 Mar 2013 04:06:39 GMT


please advise


thanks in advance

john


******************************************************************************************

error:

Template processing error: "Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String)
threw an exception when invoked on org.apache.struts2.components.Form@d6147e"

Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String)
threw an exception when invoked on org.apache.struts2.components.Form@d6147e
The problematic instruction:
----------
==> list tag.getValidators("${tagName}") as validator [on line 46, column 9 in template/xhtml/form-close-validate.ftl]
 in include "/${parameters.templateDir}/xhtml/form-close-validate.ftl" [on line 25, column
1 in template/xhtml/form-close.ftl]
----------

Java backtrace for programmers:
----------
freemarker.template.TemplateModelException: Method public java.util.List org.apache.struts2.components.Form.getValidators(java.lang.String)
threw an exception when invoked on org.apache.struts2.components.Form@d6147e
        at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:130)
        at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:93)


*****************************************************************************



alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce # cat login.jsp

<%@ taglib prefix="s" uri="/struts-tags"%>
   
<s:actionerror/>
<s:form action="signin" validate="true">
<s:textfield name="loginId" label="login"/>
<s:textfield name="password" label="password"/>
<s:submit value="logint"/>
</s:form>

*************************************************************************
alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
   
<struts>
  
   <package name="default" extends="struts-default">
 
                <action name="signin" class="loginAction">
                    <result name="success">success.jsp</result>
                    <result name="error">login.jsp</result>
                </action>
 
 </package>

</struts>

*****************************************************************************

alpha:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes # cat signin-valition.xml
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"    "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">

<validators> 
     <field name="loginId"> 
         <field-validator type="requiredstring">
            <param name="trim">true</param> 
           <message="errors.required" />       
     </field-validator>
    </field>
</validators>
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message