Samples

SamplesXml

Code

Config

API Docs

Download

Neolectric

dxp vs jsp

jsp pages are compiled into servlets

If you want to embed live Java code into your application pages then perhaps jsp is your best option. Remember that jsp pages are compiled into servlets and you have very little control over how many servlets are loaded into memory at one time. This is worth considering if you have lots of Virtual Hosts and lots of jsp pages.

dxp pages are not servlets

dxp pages are compiled into DxpPage objects and cached. You can control the maximum number of objects in the cache for each Virtual Host. You have similar control over how many sessions are cached. You can set the cleaning interval for each cache so items that have not been accessed in a while are removed automatically. When a dxp source file changes the page is automatically reparsed, recompiled and reloaded into the cache. This happens very quickly as you will find out when you begin to edit pages.

jsp is a mishmash of different symbols and idioms

The original intent of jsp was to allow Java programmers to embed html code into their servlets. It was not designed to allow webmasters or non-programmers to build applications. The jsp page description language is a hack job that mixes Java, html and off the wall symbols used by the jsp parser to recognize different constructs in a source page. A much cleaner implementation of the same concept called .jhtml was originally introduced by Sun. Unfortunately it was only availalbe in Sun products and was largely abandoned in favor of .jsp which was available from various servlet vendors.

dxp is written in xml with one minor addition

dxp pages are well formed xml, an easy transition for webmasters who can read html code. (Are there any left?) The most unfriendly symbol is probably the xml tag <![CDATA[...]]>. The ${parameter} symbol was added to access values posted by the client or stored by a tag. It does not violate xml syntax rules and was chosen to look familiar to Java programmers who use Ant.

jsp encourages page scripting

Developers are pressured by customers and managers to get results fast and the quickest route is often a quick section of embedded code. This may be appropriate small applications that contains a couple of pages. When there are lots of interdependent pages and lots of developers it may become difficult to keep track of what's going on. Documenting embedded code is usually left to the the original author who normally ignores the request. Who will maintain your application in the future?

dxp encourages the reuse of known components

dxp does not compile embedded Java code. It relies on known tags that create reusable classes. If you don't find what you need you can create new ones by subclasssing DxpNode. DxpNodes exhibit predictable behavior that is easy to test with small sample pages. The source code of DxpNode classes can be well documented with the javadoc tool. How will you javadoc the code sections of a jsp page?

jsp is tied to Java and the ever growing list of "Enterprise" requirements from Sun

If you require "buzzword compliance", heavyweight processing and commercial components then jsp may be your best solution. It's already part of the gargantuan J2EE framework and widely accepted in the commercial world. Heavy promotion by IBM and Sun certainly doesn't hurt your chances of convincing a client it's a safe bet. Given the cost and complexity of J2EE it's no surprise that php has become a popular alternative for simple webapps.

dxp decouples application pages from the backend framework

dxp pages contain well formed xml/html only. In theory you could implement the backend framework in any programming language. Mono might be the easiest alternative to Java. The current framework attempts to minimize it's reliance on J2EE features but still needs the basic functions of a servlet runner to accept client requests and respond back.

Most servlet runners are actually standalone webservers that can also accept requests from their corresponding apache module. It would be nice to have an apache module that communicates directly with a dxp framework without a servlet runner. Anyone care to build one?