Prev | Current Page 458 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


The next section will show how to implement a basic Front Controller to solve those problems.
The neko.Web Class
The standard libraries contain a very useful class neko.Web that provides facilities, in the form of static
methods, to deal with web server related issues. The class eases the approach to deal with complex stuff
like headers, the retrieving of parameters from the client request, and more. Table 9 - 2 shows the
description of the neko.Web static methods and the next section discusses how they can be used in a
real - world example.
Chapter 9: Building Websites with HaXe
237
Table 9 - 2
Neko.Web Static Method Description
cacheModule( f : Void - > Void ) :
Void
Sets the main entry point function used to handle
requests. Setting it to null will disable code caching.
flush() : Void Flushes the data to the client. Usually data is
buffered by Apache and sent in chunks; this method
permits to anticipate the submission to the client.
getAuthorization() : { user :
String, pass : String }
Returns an object containing the basic scheme
authorization sent by the client.


Pages:
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470