RE: Redirecting to a page from a MethodAdvice implementation

2014-06-19 Thread Lance Java
You could get rid of the unnecessary interface using @InjectService or a marker annotation eg: binder.bind(MethodAdvice.class, ExceptionDisplayMethodAdviceImpl.class).withId("foo"); ... @InjectService("foo") private MethodAdvice advice; More info here: http://tapestry.apache.org/defining-tapestr

RE: Redirecting to a page from a MethodAdvice implementation

2014-06-19 Thread Davide Vecchi
I'm not sure if the following is what the hints above meant, however it works, in case it can be useful to others. Thanks for the help. - package myproject.tapestry.services; import org.apache.tapestry5.plastic.MethodAdvice; public interface ExceptionDisplayMethodAdv

Re: Redirecting to a page from a MethodAdvice implementation

2014-06-18 Thread Lance Java
As a simple rule, if you instantiated the object yourself, @Inject won't work. See here: private final MethodAdvice advice = new MethodAdvice() ... You've used "new" so it's not under tapestry's control. Hello, I have the following class to handle the execution of methods that are annotated with

Re: Redirecting to a page from a MethodAdvice implementation

2014-06-18 Thread Thiago H de Paula Figueiredo
On Wed, 18 Jun 2014 12:01:16 -0300, Davide Vecchi wrote: Hi, Hi! Sorry, I don't understand. Do you mean that I'm right that PageRenderLinkSource and Response should be only injected into pages or components ? Nope. I said it can be injected into pages, components, mixins, Tapestry-I

RE: Redirecting to a page from a MethodAdvice implementation

2014-06-18 Thread Davide Vecchi
Hi, Sorry, I don't understand. Do you mean that I'm right that PageRenderLinkSource and Response should be only injected into pages or components ? Could you elaborate a little bit about including Tapestry-IoC services and objects instantiated using ObjectLocator.autobuild() ?

Re: Redirecting to a page from a MethodAdvice implementation

2014-06-18 Thread Thiago H de Paula Figueiredo
On Wed, 18 Jun 2014 11:47:16 -0300, Davide Vecchi wrote: Hello, Hi! I have the following class to handle the execution of methods that are annotated with a custom @ExceptionDisplay annotation. Everything works as expected, but I would like to redirect to a page. I'm using PageRenderLin