错误:org.apache.struts.validator.BeanValidatorForm cannot be cast to com.lzj.web.product.formbean.ProductCategoryFormstruts-config.xml配置如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd">
<struts-config>    <form-beans>
        <form-bean name="productCategoryForm" type="com.lzj.bean.product.ProductCategory" ></form-bean>
    </form-beans>
    <action-mappings>
        <action path="/control/product/type/list"  name="productCategoryForm" scope="request" validate="false">
                <forward name="list" path="/WEB-INF/page/product/producttypelist.jsp"></forward>
        </action>
    </action-mappings>
    <controller>
         <set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor"  />     
    </controller>
</struts-config>在action中表单转换时就报那个错误如: ProductCategoryForm categoryForm =(ProductCategoryForm)form;我都要崩溃 总是这些问题 困扰我学习的进度 望各位高手能指点迷津

解决方案 »

  1.   

    楼主,这个是struts1的吧,直接无视了吧,struts1没用了,直接struts2去
      

  2.   

    why do you guys still use Struts 1 or struts2. I would recommend JSF2.xFor More Information, see
      

  3.   

    你的formbean 继承 actionform了没  ?
      

  4.   

    如果已经继承ActionForm 你继承的 actioform  可能错误  普通formbean 继承 ActionForm 需要自动校验 需要继承  validatorform 
      

  5.   


    +1虽然用的少了,如果别人的项目维护用的是struts1,你能对老板说无视么.
      

  6.   

    struts1毕竟是比较成熟的技术,成功案例太多,所以学习的话,肯定这方面入手啊
      

  7.   

    我们公司现在开发新的系统还在用struts1呢