4

I'm trying to implement ajax validation in my Struts 2 application. I have included struts2-json-plugin in the build path. Whenever I start the server in Eclipse, I get the following error:

Unable to find interceptor class referenced by ref-name jsonValidationWorkflowStack - interceptor-ref - file:/C:/path/struts.xml:15:60

This is what my struts.xml looks like:

<struts>
<constant name="struts.url.includeParams" value="all" />
<constant name="struts.devMode" value="true" />
<package name="default" extends="struts-default">
    <action name="submitForm" class="action.FormAction" >
        <interceptor-ref name="jsonValidationWorkflowStack"/>
        <result>results.jsp</result>
        <result name="input">index.jsp</result>
        <result name="error">index.jsp</result>
    </action>
</package>  
</struts>

Why is this happening? I'm following the official struts2 ajax validation tutorial at.

1 Answer 1

6

You need to extend the "json-default" package.

The "struts-default" package doesn't know about the "jsonValidationWorkflowStack".

4
  • what would that look like? <package name="default" extends="struts-default,json-default">?
    – pgorsira
    Commented Jun 19, 2012 at 20:35
  • @pgpgpgpg Um... it would look like extend="json-default". Commented Jun 19, 2012 at 20:37
  • oh. so does json-default already extend struts-default? in any case the error has stopped showing. validation still isn't working but i'll poke around with it more. thx
    – pgorsira
    Commented Jun 20, 2012 at 11:53
  • @pgpgpgpg Yes. You can verify this by looking at the plugin's config file. Commented Jun 20, 2012 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.