Download

Get Loom

Request and response

Loom includes a LoomServletRequest and LoomServletResponse classes that add some features to the standard HttpServletRequest and HttpServletResponse objects:

  • Unified interface for parameters and uploaded files.
  • Stores Loom objects associated to the current request, such as the current MessagesRepository and ParsedAction instances.
  • Add browser detection. Server-side browser sniffing is not always reliable, but it is required to workaround some browser-specific bugs.

Ajax requests

Loom will identify Ajax requests realized with prototype or jQuery (or any other framework that sets the X-Requested-With HTTP header) automatically and set a request attribute to be used:

JSP pages:

<c:if test="${!ajax}">
  <!-- ...code to execute when the request was not launched using XHR -->
</c:if>

Java code:

if (request.isAjax()) {
   // whatever...
}