- Jasper framework
The Jasper framework is an open source, cross platform web development framework. It is often simply referred to as Jasper.
__TOC__
Preliminary defintions
Because Jasper supports several languages and platforms, some definitions are helpful to an understanding of its description. In Jasper parlance, a web interface provides the functionality to enable script or code running on a web server to be both referenced by a web client (usually a browser) via a URL, and to communicate its response. Common web interfaces are the CGI interface, Sun's Java
servlets model and Microsoft'sASP.NET framework. The last example in fact encompasses far more than a web interface but since this functionality is virtually all that the Jasper framework requires, this definition has been adopted. A web platform is defined as a combination of programming language and web interface. C#/ASP.NET, for example, orPerl /CGI. A web framework is defined as system that enables the generation of dynamic web content. In this sense the Jasper framework is a web framework, as the name suggests, but not a web platform.Description
Jasper currently supports (or can be said to be supported by) four web platforms. They are:
* Perl/CGI
*PHP /CGI
* C#/ASP.NET
* Java/servletsSuch is Jasper's generality that it could support many other web platforms.
In essence, Jasper is a template engine. It works by replacing instances of tokens with the appropriate content both in plain text template files, usually HTML files, and list files. The latter are used to generate content of
MIME type 'application/x-www-form-urlencoded'. Query strings in particular, the part of URLs occurring after the question mark, are of this type. To this end, Jasper employs five template classes to process template and list files, organised in a template class hierarchy that can be easily extended to process custom tokens. Tokens processed by default consists of those whose contents match the names of form variables, configuration variables, or temporary variables, in each case the token is replaced with the associated value of the variable in question. These three types of variables are stored in anassociative array , called the global properties array. Form and configuration variables are added to this array at inception by methods of the Form and Config classes which, together with the template classes, comprise Jasper's core. Temporary variables are so named because they are added to the global properties array directly in the code, and are removed immediately they are no longer needed, to keep the size of this array to a minimum.A mathematical basis
Such is Jasper's simplicity, its core classes are typically implemented with only a few dozen lines of code regardless of platform, that its workings can be completely described by
Hoare logic with only minimal extensions. The global properties array provides the state of theweb application from its inception to the communication of its generated content and its subsequent destruction. By this means both the workings of the web application during the course of a singleHTTP response, and the progression of the state of the a web application during a session of several pairs of requests and responses, which page is being shown, for example, or which form fields have been validated, can be formally specified. In this sense it contrasts sharply with other web frameworks, whose relative complexity make formal reasoning a practical impossibility.External links
* [http://jasper.sourceforge.net Jasper website]
Wikimedia Foundation. 2010.