Mike-
not understanding the situation you are presenting
can you show us your declared result types?
e.g.
.\classes\struts-actionchaining.xml
<struts>
<package name="actionchaining" extends="struts-default"
namespace="/actionchaining">
<action name="actionChain1"
class="org.apache.struts2.showcase.actionchaining.ActionChain1">
<result type="chain">actionChain2</result>
Martin
USCitizen(Contractor)
GMT+5
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission.
> Subject: RE: Why is Validation not firing?
> Date: Wed, 4 Feb 2009 15:08:00 -0500
> From: [email protected]
> To: [email protected]
>
> I hate it when I do this kind of thing. My input result was pointing to
> the wrong result. Me <-- My own worst enemy.
>
> -----Original Message-----
> From: Griffith, Michael * [mailto:[email protected]]
> Sent: Wednesday, February 04, 2009 11:13 AM
> To: Struts Users Mailing List
> Subject: Why is Validation not firing?
>
> Hello all,
>
> I must be missing something subtle about my configuration. I'm using
> Struts 2.0.11 and want to use annotation based validation, but can't
> seem to get it working.
>
> My action class has an update method as such:
> @Validation
> public class ArtifactAction extends BaseAction implements
> ModelDriven<Artifact>, Preparable, ServletRequestAware {
>
> ...
>
> @Validations( visitorFields = {...@visitorfieldvalidator(message =
> "Validation Error", fieldName = "model", appendPrefix = false)})
> public String update() throws Exception {
> artifactService.saveArtifact(artifact);
> return SUCCESS;
> }
> }
>
> The model class is marked as such:
>
> @Entity
> @Table(name = "ART", schema = "x")
> @Validation
> public class Artifact implements Identifiable, java.io.Serializable {
>
> ...
> @Lob
> @Column(name = "DESCRIPTION", nullable = false)
> @RequiredStringValidator(message="Validation
> Error",key="validate.notEmpty", trim=true)
> public String getDescription() {
> return this.description;
> }
>
> }
>
> And my struts.xml is configured to use an interceptor stack that should
> include validations:
> <interceptors>
> <interceptor
> class="...web.struts.interceptor.AcegiInterceptor" name="acegi"/>
> <interceptor-stack name="authenticated">
> <interceptor-ref name="acegi"/>
> <interceptor-ref name="paramsPrepareParamsStack">
> <param
> name="validation.validateAnnotatedMethodOnly">true</param>
> </interceptor-ref>
> </interceptor-stack>
> </interceptors>
> <default-interceptor-ref name="authenticated"/>
>
> When I submit the form:
>
> <s:form action="update" namespace="/component"
> method="post">
> <s:hidden name="id" />
> <s:textarea key="component.description"
> name="description" required="true" />
> <s:if test="id < 1">
> <s:submit key="button.create" />
> </s:if>
> <s:else>
> <s:submit key="button.update" />
> </s:else>
> </s:form>
>
> No validations fire. The update action does have an input result
> defined. What am I missing?
>
>
> Any help would be appreciated!
>
> MG
>
> ---------------------------------------------------------------------
> 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]
>
_________________________________________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/