我在使用struts2 得codebehind 和zeroconfig的时候。
将struts2 的验证框架加上。
然后问题来了,ERROR org.apache.struts2.dispatcher.Dispatcher - Could not find action or result
我的result是通过注解来配置的。
@Results( {
@Result(name = "xx", value = "xxxxxx", type = ServletActionRedirectResult.class)
})其他result是通过codebehind的方法规则来找result的。
像input 方法 对应 ActionName-input.jsp

解决方案 »

  1.   

    codebehind在struts2.1中已经被Convention Plugin所替代了,如果学习的话换成Convention Plugin吧The Convention Plugin is bundled with Struts since 2.1 and replaces the Codebehind Plugin and Zero Config plugins. It provides the following features:    * Action location by package naming conventions
        * Result (JSP, FreeMarker, etc) location by naming conventions
        * Class name to URL naming convention
        * Package name to namespace convention
        * SEO compliant URLs (i.e. my-action rather than MyAction)
        * Action name overrides using annotations
        * Interceptor overrides using annotations
        * Namespace overrides using annotations
        * XWork package overrides using annotations
        * Default action and result handling (i.e. /products will try com.example.actions.Products as well as com.example.actions.products.Index)The Convention Plugin should require no configuration to use. Many of the conventions can be controlled using configuration properties and many of the classes can be extended or overridden.
      

  2.   


    首先谢谢Landor2004的回帖
    不过我现在不能把codebehind换成convention 
    希望各位能帮我找出用codebehind 来使用验证框架