Rewrite 2.0.9.Final
We are proud to announce the availability of Rewrite 2.0.9.Final, which introduces “rewrite-config-proxy”, fixes several minor issues, and adds support for
Response.isCommitted()
, making it far simpler to perform certain operations if the response has already been committed by a prior rule or 3rd party servlet filter.
rewrite-config-proxy
Provides an easy-to-use
Operation
that allows any inbound request to be proxied to another URL – even on a different server. Headers, cookies, etc, are preserved:
To use this configuration extension, you will need to add it to your POM file:
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-proxy</artifactId>
<version>2.0.9.Final</version>
</dependency> |
<dependency>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-config-proxy</artifactId>
<version>2.0.9.Final</version>
</dependency>
Now add a rule to your
ConfigurationProvider
:
.addRule()
.when(Direction.isInbound())
.perform(Proxy.to("http://example.com")) |
.addRule()
.when(Direction.isInbound())
.perform(Proxy.to("http://example.com"))
And of course, it supports parameterization:
.addRule()
.when(Direction.isInbound().and(Path.matches("/{p}")))
.perform(Proxy.to("http://example.com/{p}?foo=bar")) |
.addRule()
.when(Direction.isInbound().and(Path.matches("/{p}")))
.perform(Proxy.to("http://example.com/{p}?foo=bar"))
response.isCommitted()
Provides a simple condition for determining whether the response has been committed or not for the current request. This is useful for aborting rewrite processing after a certain point in your configuration:
.addRule()
.when(Response.isCommitted().and(Direction.isInbound()))
.perform(Lifecycle.abort()) |
.addRule()
.when(Response.isCommitted().and(Direction.isInbound()))
.perform(Lifecycle.abort())
More issues resolved in Rewrite 2.0.9.Final:
PrettyTime 3.2.3.Final
We are proud to announce the availability of PrettyTime 3.2.3.Final, which fixes several minor issues with translation and Natural Language Parsing:
Get the updates
Get Rewrite
Get PrettyTime