Rewrite 1.1.0.Final introduces the OutputBuffer – What Servlet always wanted but could never have
- Dynamic minification of HTML, JavaScript, and/or CSS files
- Modification of output HTML or content before it is sent to the client.
- Reduction of build and development complexity by transforming LESS or SASS files into CSS on the Server
- Got more ideas?… tell us.?
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.ocpsoft.common.util.Streams;
public class OutputToLowercase implements OutputBuffer
{
@Override
public InputStream execute(InputStream input)
{
String contents = Streams.toString(input);
return new ByteArrayInputStream(contents.toLowerCase().getBytes());
}
}public Configuration getConfiguration(final ServletContext context)
{
return ConfigurationBuilder.begin()
.addRule()
.when(Path.matches("/index.html"))
.perform(Response.withOutputBufferedBy(new OutputToLowercase()));
}VERSION 1.1.0
Features & Enhancements:
- Enabled fluent chaining of additional Condition and Operation instances when adding single/custom rules by calling
ConfigurationBuilder.addRule(new CustomRule()).when(...).perform(...); - Added Response output buffering support
- JAAS support with JAASRoles condition
- Content Delivery Network support with CDN rule
- Typesafe method invocation support
- Issue #30 – Tasks may now be performed in a SubFlow without affecting the Flow of the entire Rewrite event.
- Preview of Transformer APIs
- Preview of Annotation Configuration API
Regression Impact:
- Configuration strings are now literal. Regular expressions must be configured through a parameter such as:
.defineRule().when(Path.matches("/{*}").where("*").matches(".*")) - Join no longer matches Forwarded requests.
- EL API is now a separate module and the Java package name has changed to ‘org.ocpsoft.rewrite.el’
Bug Fixes:
- Parameter binding now works on Join rules.
- Issue #67 – Keep order of fluent rules when building configuration.
- Fixed NumberFormatException on EncodeQuery operation when hashCode of checksum is modified
- Fixed ArrayIndexOutOfBounds exception for parsing query-strings with a separator but no content “?”
- Fixed showcase applications
- Issue #51 – Join no longer matches its own Forwarded requests.
- Fixed GWT integration issue where context path was not correctly transmitted when client application is hosted under the root URL “/”
- TypeBasedExpression no longer requires the expression to be surrounded by “#{…}”
- Fixed bug where container would swallow certain resource requests, resulting in false 404 errors
- Issue #32 – PhaseBinding defers validation and conversion until within the JSF lifecycle.
- Issue #33 – ClassVisitorImpl now supports adding rules to the ConfigurationBuilder if necessary
- Fixed some bugs with URLEncoding/URLDecoding
About Lincoln Baxter III
Creator of PrettyFaces - Url Rewriting for JSF, PrettyTime - Social-style date & time formatting for Java, and a community contributor to the JSF2 Expert Group; his latest project is ScrumShark, an open-source agile project management tool.
Beginning his career in C, C++ development for hardware signal testing automation, Lincoln soon moved on to Perl, dynamic programming languages, artificial intelligence and, more recently - web application frameworks such as Java Server Faces and Groovy on Grails for financial and small business solutions.
When he is not swimming, running, or playing Ultimate Frisbee, Lincoln is focused on improving the openness of Java, the Java Community Process(JCP), and bringing the J2EE platform to small businesses and freelancers.
More About Lincoln »Northern Virginia Software Symposium
November 1 - 3, 2013
Reston, VA
Current Topics on the NFJS Tour
- Core Java, JEE
- Dynamic Languages: Groovy, JRuby, Scala, Clojure
- RESTful Web Apps
- Frameworks: Hibernate, Grails, Spring, JSF, GWT, more
- Agility
- Test Driven Design
- Security
- Ajax, Flex, RIA
Why Attend the NFJS Tour?
- » Cutting-Edge Technologies
- » Agile Practices
- » Peer Exchange
Current Topics:
- Languages on the JVM: Scala, Groovy, Clojure
- Enterprise Java
- Core Java, Java 7
- Agility
- Testing: Geb, Spock, Easyb
- REST
- NoSQL: MongoDB, Cassandra
- Hadoop
- Spring 3
- Automation Tools: Git, Hudson, Sonar
- HTML5, Ajax, jQuery, Usability
- Mobile Applications - iPhone and Android
- More...
NFJS, the Magazine
May Issue Now AvailableOn the road to learning
by Raju GandhiRefactoring to Modularity
by Kirk KnoernschildRESTful Groovy
by Kenneth KousenGetting Started with D3.js
by Brian Sletten