Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Method not visible using this in pointcut

Hello,

I have a join point that need to expose the type of the instance.
I used this(type) pointcut. When I call the method getRequest() from the type this error occurs:
"The method getRequest() from the type FlowController is not visible"

I think this error is happening possibly because getRequest is a private method from FlowController. How can I solve this?

Here is my code:

private pointcut tratarExcecao(Exception ex, String actionName, PageFlowController page) :
        execution(* *Controller.exception(..)) &&
            args(ex, actionName, *, *) && this(page);

    before(Exception ex, String actionName, PageFlowController page) : tratarExcecao(ex, actionName, page) {
        String displayMessage;
        if (AppException.isMensagemNegocio(ex)) {
            String keyError = AppException.obtemKeyErro(ex);
            displayMessage = "Erro: " + actionName;
            page.getRequest().setAttribute("errorMessage",displayMessage); //ERROR HERE
        }
    }


Luiz Antonio

Back to the top