Hi,
I an new to seaside and playing with it. When a session is started I want to make a url check and if it fits some conditions to do an url rewrite (http 304).
I think I found the place where to make this check: initialRequest: But I can't find how to send a url rewrite back (I don't want to use an external http-server for that rewrite).
Any help will be appreciated :)
P.
Hi,
You can take a look at the implementation of the #testRedirectTo method in the Core tests. The WAResponse object has methods you will want to use: #redirectTo: , #movedPermanently, etc... When you find senders of these methods, you can see how to make a redirection response. Something along the lines of:
self requestContext respond: [:response | response movedPermanently; redirectTo: url]
I think this should work in the #initialRequest: method as well, but let me know if it does not.
Johan
On 10 Sep 2014, at 00:43, nova ant11.nova70@gmx.de wrote:
Hi,
I an new to seaside and playing with it. When a session is started I want to make a url check and if it fits some conditions to do an url rewrite (http 304).
I think I found the place where to make this check: initialRequest: But I can't find how to send a url rewrite back (I don't want to use an external http-server for that rewrite).
Any help will be appreciated :)
P.
seaside mailing list seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Thanks for your hints... this is the final method to do the redirect:
initialRequest: aRequest
"some conditions..." ifTrue: [ self requestContext redirectTo: '/Testurl/AAA' ]
I hope this is conform with good seaside style....
P.
On Wed, Sep 10, 2014 at 12:43 AM, nova ant11.nova70@gmx.de wrote:
Hi,
I an new to seaside and playing with it. When a session is started I want to make a url check and if it fits some conditions to do an url rewrite (http 304).
I think I found the place where to make this check: initialRequest: But I can't find how to send a url rewrite back (I don't want to use an external http-server for that rewrite).
Any help will be appreciated :)
You could also subclass WAApplication and override #handle:registering:at: or use WARestfulComponentFilter and redirect before creating a session. If you explain the problem you're trying to solve in more detail we may be able to help you better.
Cheers Philippe
seaside@lists.squeakfoundation.org