[Seaside] Question about redirection

Julian Fitzell julian at beta4.com
Thu Oct 16 11:03:13 CEST 2003


We've struggled with similar problems at work as well.  You don't, of 
course, need the host and port since you can just redirect to 
"/seaside/foo" or whatever.  But of course you don't necessarily know 
what the prefix is.  It seems to me that in your particular case, there 
ought to be some way to get the actual application object and ask it for 
a new session which would be able to give you a url for itself.  Not 
sure if the interfaces are there for that at the moment, but you could 
look into what would be needed.

Unfortunately, if the user is using HTTP 1.0, there's no way to find out 
how they got to your application.  HTTP 1.1 will give you the URL they 
used in the request headers, but 1.0 doesn't.  This is important because 
the user may have come through a particular proxy, or to a particular 
host CNAME, or through a rewritten prefix, etc.

What I ended up doing was adding a preference to our session object that 
gives a complete URL for the application.  I needed to go to this 
extreme because we send the user to an external campus-wide 
authentication server and need to give it a fully-qualified URL to send 
the user back to.

We could also look at having a preference for an entire seaside 
installation somewhere that gives the hostname and port (we had this 
once on a per-app basis but I think it's gone now).  The problem is, as 
I said above, that there may be more than one hostname/port/prefix combo 
that will get you to an app.

Julian

Brian Brown wrote:
> I'm using WARedirect response with static urls, and that works fine. 
> What I would like to do is redirect to another seaside app on the same 
> server and can't figure out how to get the host/port/prefix so that if I 
> deploy the applications on a different machine and change ports, etc. I 
> won't have to change the app.
> 
> Anyone doing that or have any pointers for me?
> 
> Thanks!
> 
> Brian
> 
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside




More information about the Seaside mailing list