[Seaside] ZnZincStaticServerAdaptor and debug

Sven Van Caekenberghe sven at stfx.eu
Wed Apr 16 09:14:09 UTC 2014


Hi François,

I suspect you are confusing two aspects. 

Zinc can catch errors in its handler and report them in a user friendly page (standard behaviour) with the proper response code, or it can let the error through so that you end up in the debugger (debugMode: true) - see ZnSingleThreadedServer>>#handleRequestProtected:

However, when using Seaside, all this is not necessary. Zinc is bit of overkill in this case, because Seaside wants to do more itself, including the error handling.

In my image, this all works fine and as expected (as per the Seaside book / the standard instructions). You should have WAWalkbackErrorHandler as #exceptionHandler.

Sven

BTW, at first sight, your code looks OK to me.

On 16 Apr 2014, at 10:55, François Stephany <tulipe.moutarde at gmail.com> wrote:

> Actually it works fine but I still doesn't have a debugger popping up in case of error. I still get a 500 page with the error message. This is how I start it:
> 
>     CCZincStaticServerAdaptor startOn: 8080.
>     CCZincStaticServerAdaptor default server debugMode: true.
> 
> Any thing that I'm missing?
> 
> 
> On Tue, Apr 15, 2014 at 6:06 PM, François Stephany <tulipe.moutarde at gmail.com> wrote:
> I quickly put this together:
> It will serve stuff placed in the assets directory (which must sit next to the image). Nothing really fancy but does the job:
> 
> ZnSeasideStaticServerAdaptorDelegate subclass: #CCStaticServerDelegate
>     instanceVariableNames: ''
>     classVariableNames: ''
>     category: 'Cocotte-Web'
> 
> CCStaticServerDelegate>>handleRequest: znRequest
>     znRequest url firstPathSegment = 'assets'
>         ifTrue: [  
>             znRequest url removeFirstPathSegment. "eats the /assets/"
>             ^self staticDelegate handleRequest: znRequest ]
>         ifFalse: [  ^self adaptor process: znRequest ]
> 
> CCStaticServerDelegate>>initializeStaticDelegate
>     | assetDirectory |
>     assetDirectory := (FileLocator imageDirectory / 'assets').     
>     ^ ZnStaticFileServerDelegate new
>         directory: (ZnFileSystemUtils directory: assetDirectory)  ;
>         yourself
> 
> And the Adaptor:
> 
> ZnZincStaticServerAdaptor subclass: #CCZincStaticServerAdaptor
>     instanceVariableNames: ''
>     classVariableNames: ''
>     category: 'Cocotte-Web'
> 
> ZnZincStaticServerAdaptor>>defaultDelegate
>     ^ CCStaticServerDelegate with: self
> 
> 
> On Sun, Apr 13, 2014 at 3:16 PM, Johan Brichau <johan at inceptive.be> wrote:
> To serve static files from a directory during development, there still is the Seaside-Filesystem package.
> -> Load the 'Filesystem' group from ConfigurationOfSeaside3
> 
> But I also do intend to replace it with serving static files from Zinc directly though. But, in the meantime, it's doing the job.
> 
> Johan
> 
> On 10 Apr 2014, at 08:39, François Stephany <tulipe.moutarde at gmail.com> wrote:
> 
> > Ok. I've got quite a bit of external files, I'll roll my own ;)
> >
> > thanks !
> > ​
> > _______________________________________________
> > 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
> 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list