ClassCastException:无法强制转换为org.apache.struts.action.Action

时间:2015-10-22 05:02:56

标签: java jsp struts-1

我正在尝试使用Struts 1.3,我添加了Form和Action的映射。我还没有在Action中实现任何代码,而且我很难看到这样的异常。

感谢您的时间。

的struts-config

<% @products.each do |product| %>
  <div class="entry">
    <%= image_tag(product.image_url) %>
    <h3><%= product.title %></h3>
    <%= sanitize(product.description) %>

    <div class="price_line">
      <span class="price"><%= number_to_currency(product.price, unit: '$') %></span>
      <%= button_to 'Add to Cart', line_items_path(product_id: product) %>
    </div>
  </div>
<% end %>

支柱瓷砖

<form-bean name="ManageCarForm" type="form.ManageCarForm"/>
<action path="/manageCar"
            type="action.ManageCarAction"
            name="ManageCarForm"
            scope="request"
            validate="false">
        <forward name="ManageCar" path="user" />
</action>

清空行动类

 <definition name="manage_Car" extends="default">
 <put name="body" value="/manage_Car.jsp"/>

表格

public class ManageCarAction  {

}

manage_Car.jsp

public class ManageCarForm extends UserForm {
    private String carIds;
    private List<String> model;
    // getters & setters

}

异常

<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<h1>Hello</h1>

0 个答案:

没有答案