Page tree
Skip to end of metadata
Go to start of metadata

Rabbtor enables easy use of server side includes which is possible in JSP pages with <jsp:include> tag with a more optimized implementation and additional functionality. 

With <jsp:include>, you can include a child request within another parent request and display its output in your parent JSP page. Rabbtor uses Grails' Framework's optimized response buffer with a few customizations to provide this functionality as a utility which can be used with other template languages. 

Currently we support, JSP, GSP and Thymeleaf. 

 

 This is different than how <c:import> JSTL tag works. With <c:import>, included page or action works on a new request. With Rabbtor, all executed actions ( parent and child(s) ) share the same web request so the parent request can set a request attribute before calling the childs which may render different responses based on the current request state.

 

Rabbtor adds to this, some other benefits by which a included action can:

  • Set response headers
  • Set cookies
  • Send redirects 
  • Set custom content type ( which only affects the included response )
  • Send response errors

Rabbtor's include implementation is also application server independent. Usually application servers put various constraints on how a request is included. Rabbtor creates its own wrappers to override these settings which works the same way for most application servers.

 

Security Warning

 Include requests are open to XSS attacks when the include parameters can in some way be changed by the visitors or original request parameters are used when a parameter is not supplied. Rabbtor solves one part of this issue, by disabling the original request parameter fallback. With <jsp:include>, when you don't provide a custom parameter to the included request, and you access a parameter with request.getParameter() within your included request, depending on the application server you are using, original request url parameter with the same name may be used. This is both error prone and creates obvious security risks. With Rabbtor's include mechanism, this is by default disabled.

High Performing Implementation

Rabbtor uses a customized and modified version of Grails include implementation ( as <g:include> tag does ) and Tomcat response wrapper. So we are grateful for the great work these guys has done there.

Rabbtor converts these to a generic API which can be used by standard Spring MVC applications and various template engines.

Rabbtor provides similar custom tags with additional parameters to make it easier to include request handler methods with their mapping name. 

Template Engine Support

Right now, Rabbtor's include support is available for JSP, GSP and Thymeleaf. We are working on to bring support to Freemarker and Velocity as well.