[Seaside] How to tell seaside to prefix it's urls

Wouter Gazendam w.f.b.gazendam at ag5.nl
Wed Nov 9 16:39:09 CET 2005


Hi,

Overriding #urlForRequestHandler: in WAApplication did lead to the
wanted behavior. Using #actionUrlForKey: did not work because images
and such did not get the prefix appended. Below the fixes:

WAApplication>>urlForRequestHandler: anObject
	| key url |
	key := (self keyOrNilForHandler: anObject)
				ifNil: [self registerRequestHandler: anObject].
	url := self baseUrl.
	self returnPathPrefix do: [:each | url path addFirst: each].
	url addParameter: self handlerField value: key asString.
	^url

And for storing the configuration:

WAApplication>>returnPathPrefix
	^(((self preferenceAt: #returnPathPrefix) ifNil: [^#()]) tokensBasedOn: $/)
		reject: [:elem | elem isEmpty]

WAGlobalConfiguration>>attributes
	^Array
		with: ((WAListAttribute key: #serverProtocol) options: #(#http #https))
		with: (WAStringAttribute key: #serverHostname)
		with: (WANumberAttribute key: #serverPort)
		with: (WABooleanAttribute key: #deploymentMode)
		with: (WAStringAttribute key: #returnPathPrefix)

Tnx,

Wouter

On 11/9/05, Bert Freudenberg <bert at impara.de> wrote:
> We're using mod_proxy with reverse proxy, too, to blend seaside apps
> into the Apache web site.
>
> However, neither mod_proxy nor mod_rewrite actually change the links
> in the generated HTML.
>
> If I'm interpreting Wouter's question correctly, he would need to set
> WADispatcher's basePath to something else than '/seaside':
>
>         WADispatcher default basePath: '/extra_prefix/seaside'
>
> For more complex URL rewriting (like adding a host part, although
> that should be unnecessary) WASession's actionUrlForKey: method looks
> promising ...
>
> - Bert -
>
> Am 09.11.2005 um 13:55 schrieb John Pierce:
>
> > mod_proxy should work as long as you utilize the reverse proxy
> > config statement as well. What you are doing is not only proxying
> > traffic to your back-end but reverse proxying your back-end. That
> > is, making your backend look like it comes from your frontend.
> > mod_rewrite will work too, but is more sophisticated and probably
> > more firepower than you need. I actively do it both ways though.
> >
> > John
> >
> > On 11/9/05, Cees De Groot <cdegroot at gmail.com> wrote: On 11/9/05,
> > Wouter Gazendam <w.f.b.gazendam at ag5.nl> wrote:
> > > All urls generated by seaside are like
> > > '/seaside/application?_s=EVRHMZeOuliCYeOO&_k=WnwLuHGE', which, of
> > > course won't end up back to the client. How do I get my seaside urls
> > > prefixed with 'https://myapp.com/extra_prefix' ? I'm running VW with
> > > SeasideForSwazoo.
> >
> > You'll need mod_rewrite for that. I can't access the file right now,
> > but if you don't manage by your own, ping me (e.g. tonight on #squeak
> > on freenode.net) and I'll dig the necessary magic incantations up from
> > my tric.nl config (which removes rather than adds a prefix but the
> > idea should be the same)
> > _______________________________________________
> > Seaside mailing list
> > Seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> >
> > --
> > It's easy to have a complicated idea. It's very very hard to have a
> > simple idea. -- Carver Mead
> > _______________________________________________
> > Seaside mailing list
> > Seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the Seaside mailing list