500 Action does not contain method named

3

I'm making a call to an action but I get the exception that the method does not exist in Action:

500 Action[/historicoAction] does not contain method named listar

Would anyone know what's going on?

Follows files:

struts-config

<form-bean name="historicoForm" type="br.com.liquigas.portal.form.HistoricoForm"/>

<forward name="/historicoAction" path="/historicoAction.do"></forward>

<action path="/historicoAction" type="br.com.liquigas.portal.action.HistoricoAction" name="historicoForm" scope="request" parameter="method">
    <forward name="success" path="/jsp/historico/historicoPedido.jsp"></forward>
    <forward name="failure" path="/jsp/historico/erro.jsp"></forward>
    <forward name="historicoPedido" path="/jsp/historico/historicoPedido.jsp"></forward>
    <forward name="historicoProduto" path="/jsp/historico/historicoProduto.jsp"></forward>
</action>

JSP

<a class="ovalbutton" href="#" onclick="return avancar();"><span>Avan&ccedil;ar</span></a>

Javascript

function avancar(){
    $("#method").val("listar");
    $('#historicoForm').submit();
    alert("Avancou");
    return false;
}

FORM

public class HistoricoForm extends GenericForm {

    private static final long serialVersionUID = 7434349782026204632L;

    /**
     * Filtro da tela com o numero do pedido
     */
    private String numeroPedido;

    /**
     * Filtro da tela com o codigo do cliente
     */
    private String codigoCliente;

    /**
     * Filtro da tela com a Dta Inicial da pesquisa
     */
    private String dataInicial;

    /**
     * Filtro da tela com a Dta Final da pesquisa
     */
    private String dataFinal;

    /**
     * Lista com as informações do historico
     */
    private List historicoList;

    /**
     * Lista com as informações do Histórico do produto, a tela de detalhe do historico
     */
    private List historicoProdutoList;

    /**
     * parametro da jsp
     */
    private String method;

    /**
     * @return o numeroPedido
     */
    public String getNumeroPedido() {
        return numeroPedido;
    }

    /**
     * @param numeroPedido o numeroPedido a ser configurado
     */
    public void setNumeroPedido(String numeroPedido) {
        this.numeroPedido = numeroPedido;
    }

    /**
     * @return o codigoCliente
     */
    public String getCodigoCliente() {
        return codigoCliente;
    }

    /**
     * @param codigoCliente o codigoCliente a ser configurado
     */
    public void setCodigoCliente(String codigoCliente) {
        this.codigoCliente = codigoCliente;
    }

    /**
     * @return o dataInicial
     */
    public String getDataInicial() {
        return dataInicial;
    }

    /**
     * @param dataInicial o dataInicial a ser configurado
     */
    public void setDataInicial(String dataInicial) {
        this.dataInicial = dataInicial;
    }

    /**
     * @return o dataFinal
     */
    public String getDataFinal() {
        return dataFinal;
    }

    /**
     * @param dataFinal o dataFinal a ser configurado
     */
    public void setDataFinal(String dataFinal) {
        this.dataFinal = dataFinal;
    }

    /**
     * @return o historicoList
     */
    public List getHistoricoList() {
        return historicoList;
    }

    /**
     * @param historicoList o historicoList a ser configurado
     */
    public void setHistoricoList(List historicoList) {
        this.historicoList = historicoList;
    }

    /**
     * @return o historicoProdutoList
     */
    public List getHistoricoProdutoList() {
        return historicoProdutoList;
    }

    /**
     * @param historicoProdutoList o historicoProdutoList a ser configurado
     */
    public void setHistoricoProdutoList(List historicoProdutoList) {
        this.historicoProdutoList = historicoProdutoList;
    }

    /**
     * @return o method
     */
    public String getMethod() {
        return method;
    }

    /**
     * @param method o method a ser configurado
     */
    public void setMethod(String method) {
        this.method = method;
    }

ACTION

public ActionForward listar(ActionMapping mapping, ActionForm form, 
        HttpServletRequest request, HttpServletResponse response) throws Exception {
    ...
} 
    
asked by anonymous 06.01.2015 / 16:59

1 answer

2

Well, I managed to solve my problem with a simple change in the parameters of the ActionForward method. The problem was the method:

public ActionForward detail (ActionMapping mapping, ActionForm form,              HttpActionRequest request, ActionResponse response) throws Exception { }

I also tried the: public ActionForward detail (ActionMapping mapping, ActionForm form,              HttpRequest request, ActionResponse response) throws Exception { }

and did not work ....

Fixed with

public ActionForward detail (ActionMapping mapping, ActionForm form,              ActionRequest request, ActionResponse response) throws Exception { }

    
12.01.2015 / 13:08