Re: Does the onActivate method can't return a Page?

2008-12-26 Thread Bill Holloway
My guess is that the page activation context isn't designed for this. There are a couple of workarounds. One would be to inject the Response service (org.apache.tapestry5.services.Response) into your page class and then use it to perform the redirection in your onActivate method: @Inject

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread d0ng
Thanks for your reply. But I find a comment The activate event handler may also return a value, which is treated identically to a return value of a component event request event trigger. This will typically be used in an access validation scenario. from the page

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread Thiago HP
Have you tested your Index page separately? Your code looks correct. On Wed, Dec 24, 2008 at 12:59 PM, d0ng agile.j...@gmail.com wrote: Hi, I have a page that's used to redirect request to other page in some case,but I don't make it work well. For example,in the test code the Index page can't

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread d0ng
Yes,I have tested the Index page separately,it works well when I request it. Thiago HP ??: Have you tested your Index page separately? Your code looks correct. On Wed, Dec 24, 2008 at 12:59 PM, d0ng agile.j...@gmail.com wrote: Hi, I have a page that's used to redirect request to other page

Re: PageLinkTarget, where did it go?

2008-12-26 Thread Mark Horn
We also use spring-security and ran into some issues as well. What we ended up doing was adding something like this to the JUnit #setUp method /* (non-Javadoc) * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { super.setUp();

Re: Tapestry 5 with Spring Security - problem with unit tests.

2008-12-26 Thread Mark Horn
We also use spring-security and ran into some issues as well. What we ended up doing was adding something like this to the JUnit #setUp method /* (non-Javadoc) * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { super.setUp();

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread Bill Holloway
I set up just such a page, and have it working. It returns my index just fine. I'm using 5.0.18, JDK 1.5, Jetty 6.1.8. Bill On Fri, Dec 26, 2008 at 8:24 AM, d0ng agile.j...@gmail.com wrote: Thanks for your reply. But I find a comment The activate event handler may also return a value,

Set locale using url

2008-12-26 Thread Tomas Kolda
Hello all, I'm new to Tapestry and maybe I want to do something non-standard. I want to set locale using urls. http://www.example.com/en/./ http://www.example.com/fr/./ I also write simple filter that do setting of locale, but I need to change something that strips language from URL

Re: Tapestry 5 with Spring Security - problem with unit tests.

2008-12-26 Thread MichaƂ Jedynak
Thanks for the reply! I came up with a similar solution: I pass SecurityModel class from tapestry-spring-security to instance of PageTester: tester = new PageTester(appPackage, appName, src/main/webapp,SecurityModule.class); and then I just create

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread d0ng
I got it. The different behavior of this question may be cause by the setting of SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS. In my developing product,the value of SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS is set to true,then the response is empty. When I set it to false,the

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread Bill Holloway
It seems to me the default on that should be true. I certainly would want to give permission for suppression of my redirects rather than having that be the default! :) Bill in Austin On Fri, Dec 26, 2008 at 12:47 PM, d0ng agile.j...@gmail.com wrote: I got it. The different behavior of this

Re: Does the onActivate method can't return a Page?

2008-12-26 Thread Mark W. Shead
I use this all the time and it works. For example: @InjectPage private Login loginPage; Object onActivate() { if(!userExists) { loginPage.setNext(this.getClass()); return loginPage;