Introduction to Hybrid Server Pages

Hybrid Java News Feed

FREE FOR NON-COMMERCIAL USE

This site offers a new Java™-based technology for programming dynamic web content. The obvious and common approach to this well known task is to combine mark-up and decision-taking information in one text. This means combining in one compact source HTML and operators of some general programming language. One old way of doing that is to embed HTML into a program e.g. writing print("<HTML>") in a CGI/C program. Another, more recent - to embed elements of programming language into HTML. There is also a symmetric way of doing things and Java Server Pages (JSP) technology is of that kind. Unfortunately that seems to be the only advantage of JSP.

HybridJava(HJ) is a new language that is a symmetric cross between Java and HTML and in this sense HJ is a direct successor of JSP. The great difference is that JSP processor is just a 'template engine' - it performs a blind text substitutions while HJ is a strictly defined compilable language that equally incorporates Java and HTML.

The immediate advantage of HJ over JSP is a dramatic drop of junk syntax of <% and %> delimiters that usually makes JSP pages barely readable. Another immediate advantage is earlier check for syntax errors.

Besides Java and HTML entities the HJ syntax has a simple but powerful support for code factorization and reuse. Widgets are defined in HJ  code and that does not lead to any additional Java programming. Unlike known implementations of user-defined tags HJ widgets may have several named points of insertion. Recursive usage of widgets is supported. A unique feature is transparency of widgets for Java context when variables from a page are accessible in its widgets.

For each page the compiler generates a presentation Java class (P-class) with a method ($render) that, when executed, provides HTML output sent to the client. Code of widgets gets properly inserted into the generated class.

Pages may have a corresponding Java class for page state (PS-class) that contains session-persistent data of the page and/or methods operating on that data. The $handlePage is a special method known to and called by the framework. P-class is created as derived from PS-class so all the non-private members of the latter are plainly accessible in the former and thus in $render and in the page and widgets HJ source. 

Widgets may have a corresponding Java class for widget state (WS-class) that contains session-persistent data of the widget and/or methods operating on that data. The $handleWidget is a special method known to and called by the framework. While processing a widget compiler generates access to identifiers defined in its WS-class. Together a widget plus  its WS-class (when provided) constitute a component. The framework supports  transmission of messages from a component to a senior component or to the page. Components declared as "shared" may be used on several pages with a single component data instance used.

HybridJava language is extremely easy to learn for those who already know both Java and HTML - a comprehensive description of HJ language is just few pages long.

Hybrid Server Pages technology is not aggravated with any kind of configuration (so far). In fact compiler internally generates configuration based merely on the set of .page, .widget and .java files available.

Hybrid Server Pages technology is not a client-side technology though its framework relies on some basic JavaScript. However it is pretty compatible with anything like AJAX. Any client-side entities naturally map to HJ widgets.

Hybrid Server Pages technology is not about load balancing or about data persistence beyond  Http Session. In fact the Hybrid Server Pages domain lies strictly within the Presentation Layer. It does not matter if behind the Presentation Layer the application uses Hibernate, EJB persistence or JDBC to access data storage.

Hybrid Server Pages technology is not a "template engine". It capitalizes upon real compilation and thus upon a deep machine understanding of the application code.

Hybrid Server Pages technology does not provide any predefined widgets. Those included into the release ZIP are just samples. Our presumption is that technology should in many occasions make it easier to write your own set of widgets than to study those predefined. Do you know why there are so many much alike sites these days?

Hybrid Server Pages framework does not include navigation engine. And was not expected to.

Hybrid Server Pages is PURE JAVA and PURE SERVER-SIDE Presentation Layer Technology.

The distributive .zip file contains:

    1) HybridJava Compiler

    2) Documentation (this Introduction, HJ language description and JavaDoc of the API)

    3) Source codes of a Sample Application and build scripts for it

    4) Tests on Compiler diagnostic

    5) LICENSE.txt file

    6) README.txt file

To enter a Sample Website click here

In version 0.94:

  • Multiple bugs fixed

  • Shared components introduced

FREE FOR NON-COMMERCIAL USE
Download: http://www.HybridServerPages.com/HybridJava_v0.94.zip
Feedback: dev@hybridserverpages.com

Java is a registered trademark of Sun Microsystems, Inc., in the United States and other countries.