Welcome to AjaxAnywhere

AjaxAnywhere is designed to turn any set of existing JSP or JSF components into AJAX-aware components without complex JavaScript coding.

In contrast to other solutions, AjaxAnywhere is not component-oriented. You will not find here yet another AutoComplete component.

Simply separate your web page into multiple zones, and use AjaxAnywhere to refresh only those zones that needs to be updated.

How it works

The idea is simple:

  1. Mark "reload-capable" zones of a web page with AjaxAnywhere custom tags.
  2. Instead of submitting a form in traditional way, do it by AjaxAnywhere javascript API.
  3. During request processing on the server-side, determine the zones to refresh. (You can implement this logic either on the client-side via JavaScript or on the server-side, via AjaxAnywhere API.)
  4. On the server-side AjaxAnywhere will generate an XML containing only the "updated" HTML.
  5. On the client-side AjaxAnywhere javascript will receive the XML, parse it and update the selected zones.

Advantages

  • Less JavaScript to develop and to maintain. Absence of commonly accepted naming convention, formatting rules, patterns makes JavaScript code messier then Java/JSP. It is extremely difficult to debug and unit-test it in multi-browser environment. Get rid of all those complexities by using AjaxAnywhere.
  • Easy to integrate. AjaxAnywhere does not require changing the underlying application code.
  • Lower technical risk. Switch whenever you need between AJAX and traditional (refresh-all-page) behaviour of your web application. Your application can also support both behaviors.
  • Default graceful degradation. You do not need to develop another intreface for older browers support. If XMLHttpRequest is not available, application will keep working in traditional way, refreshing the entire page.
  • Free open source license.

Restrictions (price to pay)

  • AxajAnywhere is not as dynamic as pure-JavaScript AJAX solutions. Despite that AjaxAnywhere will probably cover your needs, to achieve certain functionality you might need to develop JavaScript.
  • Today, you can only update a set of complete DHTML objects without breaking then apart. For example, you can update a content of a table cell or the whole table, but not the last row, for example. In later versions, we plan to implement partial DHTML update, as well.

Browser support

Client-side scripts were tested on Microsoft Internet Explorer, Mozilla Firefox (both Windows and Linux), and Opera. Your help in cross-browser testing and JavaScript improvement is greatly appreciated.

Other features

  • JavaScript received by AJAX is treated in a special way. AjaxAnywhere executes it via eval(""), it is also able to extract the declared functions into the proper context. (as if the page was reloaded completely). However, it is impossible to execute document.write() command inside AJAXable zone.
  • The zones to reload might be known before submitting the request. In this case, override AjaxAnywhere.getZonesToReload() JavaScript function on the client-side. No additional server side logic is necessary.
  • response.sendRedirect() during Ajax request is transformed into location.href=.. JavaScript commmand.