Home       Servicebereich  Projekte  Kontakt  

WebApp


WebApp - Framework to build web applications

WebApp is a framework to build web applications. The HTML pages will build of a set of templates. You can use HTML::Template or HTML::Libtemplate (default) as your template language. This and other configurations will be done with a hash that you commit to the constructor. The body of application will be defined in one or two classes defined in REQUEST and RESPONSE configuration variables. WebApp will first call the ->new() method of the REQUEST class (if REQUEST is defined) and than the REQUEST method to use. The methods should do the business logic of your application. After calling the REQUEST method, the optional end() method of REQUEST will be called. All methods will call with a request object as the second parameter. After this, the constructor new() and the current RESONSE method to use will be called. At the end, the optionally end() class will called too. Here you can for example define the footer of your response page. the RESPONSE class will be called. This class is responsible to build the resonse page for the current request. If you configure only a RESPONSE class, only this will be used. On bigger applications it might be cleaner to separate business logic and content genenation. You could decide in your REQUEST handler which class on your response method should build the curent response when setting response->RES() to a new value. Controlling which methods will be called If none of the variables RES and REQ is set in the request, the last component of your path (without any filename ending like .html or .cgi) is called as the method in your application classes. E.g. if you call http://your.server.com/custom/app.html, the method app of your response and request (if defined REQUEST) will be called. If you call only /custom, the method custom will be called. You can influence this behavior if you set the variables RES and REQ in your request. In this case the filename setting will be overwritten and the identical methods will be called.

Download: WebApp.tar.gz




< zurück  | weiter >