You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by albaeck <op...@gmail.com> on 2011/09/26 01:56:49 UTC

Page isn't rendered after redirect from onActivate

Hi all. I'm totally new to Tapestry and would like someone to shed some light
on what's happening:

I'm sending POST via https and would like some handler (like a page without
actual template) to handle this request and redirect/propagate to
appropriate pages (they are valid and renders just fine) based on given
parameters. 
In tml :
var params='par1=1&par2=2';
 httpRequester.open("POST", url + "/myPostHandler", true);
    httpReq.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
    httpReq.setRequestHeader("Content-length", params.length);
    httpReq.setRequestHeader("Connection", "close");
    httpReq.send(params);

In @Secure myPostHandler (just java, with no tml dedicated): Object
onActivate():

if(par1 = 1) {
   return Par1Page.class;
} ... so on

Problem is that I can't get Par1Page rendered at all. I'm inspecting some of
its components (renderSetup()) and see that method is invoked end executed
after redirection. No exceptions. Just doesn't work.

I suspect that it is a lack of tapestry under the hood knowledge, but could
you please answer what's going wrong?

Probably, there are some other solutions/practices that do the same, please
suggest then.

Thank you very much for support!


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-isn-t-rendered-after-redirect-from-onActivate-tp4839753p4839753.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Page isn't rendered after redirect from onActivate

Posted by Geoff Callender <ge...@gmail.com>.
You're trying something that is outside my area and I can't test what you're doing but here are some thoughts that may help.

Have you put a breakpoint in onActivate, or logged it with @Log, to see confirm that Par1Page is being returned?

Have you checked in your browser network page that the response to myPostHandler is an HTTP 302 Redirect to par1Page? It should be.

Tapestry expects requests to be in certain formats. The formats are those that are generated by PageLink, EventLink, and Form. PageLink and EventLink use HTTP GET. Form uses HTTP POST. If you stray outside those then maybe you get undefined behaviour, but I really don't know. You can see the expected formats here:

	http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/activationcontext1
	http://jumpstart.doublenegative.com.au/jumpstart/examples/input/eventlinks/0
	http://jumpstart.doublenegative.com.au/jumpstart/examples/input/forms1

You are using POST, so Tapestry is probably expecting the page to have a corresponding for, and the request to look the one that Form generates. See

	http://jumpstart.doublenegative.com.au/jumpstart/examples/input/forms1

Do you have to use POST instead of GET? Perhaps you could use get with query parameters? See "By Query String" in

	http://jumpstart.doublenegative.com.au/jumpstart/examples/state/passingdatabetweenpages

If none of this helps then can I suggest you tell us what you're trying to achieve and why, and post your MyPostHandler source here in entirety.

Cheers,

Geoff


On 26/09/2011, at 10:21 PM, albaeck wrote:

> Thanks for reply! 
> If I'm under http (not https and having @Secure removed) setupRender() of
> all page components are invoked. No exceptions. Page is not rendered though.
> 
> I use tomcat-6.0.33, no ballancer, etc. 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Page-isn-t-rendered-after-redirect-from-onActivate-tp4839753p4841178.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Page isn't rendered after redirect from onActivate

Posted by albaeck <op...@gmail.com>.
Thanks for reply! 
If I'm under http (not https and having @Secure removed) setupRender() of
all page components are invoked. No exceptions. Page is not rendered though.

I use tomcat-6.0.33, no ballancer, etc. 

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-isn-t-rendered-after-redirect-from-onActivate-tp4839753p4841178.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Page isn't rendered after redirect from onActivate

Posted by Geoff Callender <ge...@gmail.com>.
Does it work if you use http, not https, and without @Secure? 
Are you going through Apache to get to your web server? 
What web server are you using?

On 26/09/2011, at 8:38 PM, albaeck wrote:

> Hi again, more details below...
> 
> I suppose that all comuniucation within JS->Handler->redirect is done via
> https. So, page (Par1Page, I'm going to redirect to) is marked as @Secure.
> Handler is also marked. Interesting things are:
> 1. Redirect works as expected when handler is invoked through a browser
> (htts://localhost:8443/myPostHandler)!
> 2. After redirect, Par1Page's onActivate (as well as component's
> renderSetup()) are invoked only if I use https accessing site. But page
> isn't rendered. 
> 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Page-isn-t-rendered-after-redirect-from-onActivate-tp4839753p4840910.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Page isn't rendered after redirect from onActivate

Posted by albaeck <op...@gmail.com>.
Hi again, more details below...

I suppose that all comuniucation within JS->Handler->redirect is done via
https. So, page (Par1Page, I'm going to redirect to) is marked as @Secure.
Handler is also marked. Interesting things are:
1. Redirect works as expected when handler is invoked through a browser
(htts://localhost:8443/myPostHandler)!
2. After redirect, Par1Page's onActivate (as well as component's
renderSetup()) are invoked only if I use https accessing site. But page
isn't rendered. 




--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-isn-t-rendered-after-redirect-from-onActivate-tp4839753p4840910.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org