December 19th, 2020 by Lincoln Baxter III

PrettyTime 5.0.0.Final Released – New APIs, JDK 8 DateTime support

We are proud to announce the 5.0.0.Final version of PrettyTime. This release includes several bug-fixes, an improved NLP (time parsing) module, new methods for more convenient configuration of time units, and support for the JDK 8 DateTime API:
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

Get PrettyTime 5.0.0.Final

February 22nd, 2018 by Craig Schwarzwald

Appium: Running the same suite across multiple OSes

If you follow the principles in this article and utilize the open source framework [link coming soon] I refer to as a base to your Appium test suite, you will find yourself able to run the same tests across any multitude of OSes and/or device types! With the patterns I lay out below and the open source framework as a starting point, you can get a leg up on all your competitors in the mobile test automation space!
August 30th, 2017 by Craig Schwarzwald

Flakiness of Corporate Selenium Suites and how to get rid of it

If you follow the principles in this article and utilize the open source framework I refer to as a base to your selenium suites, you will find your tests to be STABLE, MAINTAINABLE, and EASY TO READ / CREATE, throughout your entire enterprise! These 3 key pillars are something that every company strives for in their automation, but it seems like few actually achieve. WIth the patterns I lay out below and the open source framework as a starting point, you can get a leg up on all your competitors in the test automation space!
August 3rd, 2016 by Team

Rewrite 3.4.0.Final Release Announcement

We are pleased to announce the latest version of the Rewrite Servlet Toolkit, and PrettyFaces libraries. It’s been quite a while since our last release, but we promise you this new version has been worth the wait.

Release notes:

You might notice we skipped a few version numbers, which we’ve done for several reasons:

  • This is a major update, so we incremented from major version 2 to version 3.
  • The deprecated (original) prettyfaces-jsf library, which is now several years obsolete was versioned 3.3.3, and has been confusing new users for some time. We are now resolving this issue by skipping directly to Rewrite version 3.4.0.Final.

This release includes several major new features as well as a plethora of bug-fixes, including:

  • Support for JDK6 has been dropped, JDK7 is the new minimum requirement
  • Improved compatibility with JDK8 for the annotation scanning
  • Major performance improvements in the logging subsystem
  • Major performance improvements with the URLBuilder
  • Fixed some concurrency issues which occurred in high load scenarios
  • Many improvements for the LocaleTransposition feature
  • Support conditional parameters with JSF’s <f:param>
  • Fault tolerant percent decoding for path and query parameters
  • Simpler condition trees when binding query parameters using annotations, results in better faster evaluation performance
  • Fixes handling of context path for applications deployed to the root context
  • Improved error reporting. Exception stack traces now display the rule that errored and the location where that rule was defined (including file and line number)
  • Strict RuleBuilder ordering and structure enforcement

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/rewrite
February 24th, 2015 by Matyas Danter

SEO-friendly AngularJS with HTML5 pushState(), Rewrite, and twelve lines of code

ng_logo

While migrating an e-commerce application (piqchocolates.com) from Grails and Tomcat to an AngularJS, Java EE (JAX-RS), and JBoss WildFly stack, I had to make sure that the new platform has feature parity in all areas that are valuable to our business. Search Engine Optimization (SEO) is crucial for us because we primarily market our business on-line. In short, we need search engine optimized URLs, and deep linking; this article will show you how to implement both.

January 16th, 2015 by Lincoln Baxter III

Simple Java EE (JSF) Login Page with JBoss PicketLink Security

Several years ago I wrote a tutorial about using Acegi/Spring Security with JavaServer Faces (JSF) to create a simple authentication / Login page; however, times have changed and Java EE is back in action. I would no longer consider Spring a “requirement” when building a Java EE application. More specifically, if you are using the core Contexts and Dependency Injection (CDI) framework that serves as the backbone for the entire Java EE framework, Spring Security becomes less attractive (because it’s not compatible without using Spring itself, and Spring is a replacement for CDI).

This article will explore how to create a JSF login backed by the standards-compliant CDI framework (that is included with Java EE), and the PicketLink security framework (an open-source project from JBoss). Examples for this article were sourced from the very comprehensive, and quite understandable quick-start application from the PicketLink project itself.

December 23rd, 2014 by Lincoln Baxter III

PrettyTime 3.2.7.Final Released (Social-style time formatting for Java)

Happy Holidays!

I am proud to announce the immediate availability of OCPsoft PrettyTime 3.2.7.Final, the open-source social-style time formatting library for Java.

PrettyTime allows you to create human-readable timestamps such as “3 minutes ago” or “just now”, and is used in other open-source tools such as JBoss Tools, and JBoss Developer Studio.

Release Notes:

This release contains new translations for Turkamen (tk-TM) and translation spelling/grammar revisions for several other language bundles. Additionally, we have resolved an issue with precise time calculations that caused PrettyTime to print multiple instances of the same time unit when using custom time-unit configurations.

Get PrettyTime!

Enjoy, and happy holidays,
Lincoln and the OCPsoft team.

May 2nd, 2014 by Lincoln Baxter III

How to interrupt a long-running “infinite” Java regular expression

If you’ve ever done a lot of work with Regular Expressions, you’re probably familiar with the concept of catastrophic backtracking, which means that the engine is forced to calculate permutations of exponential proportions. For instance, click here run this example and see how long it takes (should be about 5-10 seconds to time out):
LongRunningRegexExample.java
public class LongRunningRegexExample
{
   public static void main(String[] args) throws InterruptedException
   {
      final Pattern pattern = Pattern.compile("(0*)*A");
      final String input = "00000000000000000000000000";

      long startTime = System.currentTimeMillis();
      Matcher matcher = pattern.matcher(input);
      matcher.find(); // runs for a long time!
      System.out.println("Regex took:" + (System.currentTimeMillis() - startTime) + "ms");
   }
}
However, a small change results in near instantaneous response. Why?
February 13th, 2014 by Team

Rewrite 2.0.11.Final Released – New i18n Features

We are proud to announce the release of Rewrite Servlet Toolkit 2.0.11.Final.

Highlights

This version includes new support for internationalization and localization. Additionally, support for annotation scanning on the WebLogic application server has been improved.

Security Notice

If you are currently using Rewrite 2.0.9.Final and have not yet updated, you should update to Rewrite 2.0.10.Final or 2.0.11.Final as quickly as possible, since we have fixed a minor concurrency issue when using the PhaseOperation configuration element that can potentially cause cross-request information bleeding.

Get Rewrite

http://ocpsoft.org/rewrite/
December 10th, 2013 by Lincoln Baxter III

Rewrite 2.0.9.Final and PrettyTime 3.2.3.Final Released (Introducing Proxy Support)

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>
Now add a rule to your 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"))

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())

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