我以前请求都没有这个错 现在就有了:
Unable to instantiate Action, com.babasport.action.BuyerAction, defined for 'buyerAction_login' in namespace '/buyer'Failed to convert property value of type [com.babasport.action.BuyerAction] to required type [com.babasport.pojo.Buyer] for property 'buyer'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.babasport.action.BuyerAction] to required type [com.babasport.pojo.Buyer] for property 'buyer': no matching editors or conversion strategy found
配置文件:
<package name="buyer" extends = "struts-default" namespace = "/buyer" >
<action name="buyerAction_*" class = "com.babasport.action.BuyerAction" method = "{1}">
<result name="success">/BuyCar.jsp</result>
<result name = "{1}_success">/login.jsp</result>
<result name = "{1}_error">/register.jsp</result>
<result name="logins_success">/login_index.jsp</result>
<result name="logins_fail">/login.jsp</result>
</action>
</package>
请求路径:http://localhost:8080/baba1.2/buyer/buyerAction_login.
Unable to instantiate Action, com.babasport.action.BuyerAction, defined for 'buyerAction_login' in namespace '/buyer'Failed to convert property value of type [com.babasport.action.BuyerAction] to required type [com.babasport.pojo.Buyer] for property 'buyer'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.babasport.action.BuyerAction] to required type [com.babasport.pojo.Buyer] for property 'buyer': no matching editors or conversion strategy found
配置文件:
<package name="buyer" extends = "struts-default" namespace = "/buyer" >
<action name="buyerAction_*" class = "com.babasport.action.BuyerAction" method = "{1}">
<result name="success">/BuyCar.jsp</result>
<result name = "{1}_success">/login.jsp</result>
<result name = "{1}_error">/register.jsp</result>
<result name="logins_success">/login_index.jsp</result>
<result name="logins_fail">/login.jsp</result>
</action>
</package>
请求路径:http://localhost:8080/baba1.2/buyer/buyerAction_login.
你的实体类声明是不是有问题
在BuyerAction 声明下 Buyer buyer = new Buyer(); 并生成get set方法
不过你对Action映射的配置文件改成其他名字,问题应该解决了。
private Buyer buyer=new Buyer();我写了 set 和 get 方法 这里就不写了页面上
<input type = "text" class = "input_info" id = "uname" size = 20 name = "buyer.username"/> 由 form 提交
请求路径:http://localhost:8080/baba1.2/buyer/buyerAction_login.
异常 把 buyer[com.babasport.pojo.Buyer] 转换成[com.babasport.action.BuyerAction]
出错
贴点代码吧