public void showMeJDK8() throws Exception { PrettyTime t = new PrettyTime(); Assert.assertEquals("3 months from now", t.format(LocalDateTime.now().plusMonths(3))); } }
Improvements in the NLP module (based on Natty.) Updated to version 0.13.0
public void showMeJDK8() throws Exception { PrettyTime t = new PrettyTime(); Assert.assertEquals("3 months from now", t.format(LocalDateTime.now().plusMonths(3))); } }
Improvements in the NLP module (based on Natty.) Updated to version 0.13.0
You might notice we skipped a few version numbers, which we’ve done for several reasons:
This release includes several major new features as well as a plethora of bug-fixes, including:
Thank you for continuing to support us, provide valuable feedback, and use our technologies.
And of course, please get involved in the project at http://github.com/ocpsoft/rewritePhaseOperation
configuration element that can potentially cause cross-request information bleeding.
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.
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> |
ConfigurationProvider
:
.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(Response.isCommitted().and(Direction.isInbound())) .perform(Lifecycle.abort()) |
public void exampleUnitConfiguration() { JustNow unit = t.getUnit(JustNow.class); unit.setMaxQuantity(1); // This means that "just now" will only be used to represent one millisecond difference between the target time and reference time. (the default is 5 minutes.) }
Improvements in the NLP module (based on Natty.) include more resilient parsing of date offsets such as “the day before yesterday,” which previously resulted in a date that actually represented “yesterday.”
If you experienced problems with rule parameterization in Rewrite 2.0.7.Final, then sorry about that, and this release of [[Rewrite]] is for you: https://github.com/ocpsoft/rewrite/issues/133
Erroneous failures such as the following exception should be fixed by this release:
org.ocpsoft.rewrite.exception.ParameterizationException: The value of required parameter [s] was null. at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.extractBoundValues(RegexParameterizedPatternBuilder.java:262) at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.build(RegexParameterizedPatternBuilder.java:136) at org.ocpsoft.rewrite.servlet.config.Forward.performHttp(Forward.java:85) at org.ocpsoft.rewrite.servlet.config.HttpOperation.perform(HttpOperation.java:42) at org.ocpsoft.rewrite.servlet.config.rule.Join.perform(Join.java:264)
Rewrite will now display version information at application boot time: https://github.com/ocpsoft/rewrite/issues/129
02:37:34,570 INFO [org.ocpsoft.rewrite.servlet.RewriteFilter] (ServerService Thread Pool -- 68) Rewrite 2.0.8.Final initialized.
Compilation mode may now be set on JRuby based Transform modules: https://github.com/ocpsoft/rewrite/issues/131
We are glad to announce the latest version of [[Rewrite]], servlet toolkit and URL-rewriting extensions. This release includes serveral bug fixes and enhancements:
We heard you! It is now much easier to register ConfigurationProvider
objects. You can forget about creating a service file, and simply use the convenient @RewriteConfiguration
annotation:
import org.ocpsoft.logging.Logger.Level; import org.ocpsoft.rewrite.annotation.RewriteConfiguration; import org.ocpsoft.rewrite.config.Configuration; import org.ocpsoft.rewrite.config.ConfigurationBuilder; import org.ocpsoft.rewrite.config.Log; import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider; @RewriteConfiguration public class ApplicationConfigurationProvider extends HttpConfigurationProvider { @Override public Configuration getConfiguration(ServletContext context) { return ConfigurationBuilder.begin() .addRule() .perform(Log.message(Log.message(Level.INFO, "Rewrite is active."))) ; } @Override public int priority() { return 0; } }
Read the installation guide, or configuration manual.
<dependency> <groupId>org.ocpsoft.rewrite</groupId> <artifactId>rewrite-servlet</artifactId> <version>2.0.7.Final</version> </dependency>
We are pleased to announce the release of Rewrite 2.0.5.Final, which includes several bug fixes and enhancements.
Rewrite is an OpenSource, Filter-based Servlets extension for Java – enabling creation of bookmark-able, pretty URLs. Rewrite solves the “RESTful URL” problem elegantly, including features such as: page-load actions, managed parameter parsing, seamless integration with CDI, Spring, and configuration-free compatibility with other web frameworks.
Issue #109 – Context root is appended twice when using Navigate.to() class
Issue #110 – View IDs with hard-coded query parameters were working in PrettyFaces 3, but no longer in PrettyFaces with Rewrite.
Other critical issues fixed in prior releases have continued to be tested for security holes. If you use container-based security, and have not yet upgraded from Rewrite 2.0.3.Final, you should Immediately upgrade to 2.0.4 or 2.0.5.Final because of the following issue:
Issue 111 – Container based security is circumvented when Rewrite is installed
Additionally, we (mostly Christian) have put a good deal of work into the documentation and migration guide from Rewrite 1.x and PrettyFaces to Rewrite 2.x: You can find that guide here: http://ocpsoft.org/rewrite/docs/migration/prettyfaces3 – which is part of a larger effort to improve our documentation entirely. And of course, if you have any questions or concerns, please let us know on the forums, or submit an issue to our issue tracker.
Go get Rewrite now!
We hope you enjoy this latest release of Rewrite!
~Lincoln and the Rewrite Team