OCPsoft Rewriteをバージョン1.0.5.Finalから1.1.0.Finalに更新すると、次のルールが機能しなくなり、修正方法がわかりません。
.addRule(
Join.path("/{i}/{d}")
.where("i").matches("[-_a-zA-Z0-9~*]{8}")
.where("d").matches("[-_a-zA-Z0-9~*]{32}")
.to("/resources/html/user/doSomething.html?i={i}&d={d}")
)
Rewrite変更ログには、私を助けるのに役立つ可能性のある1つのポイントがあります。
構成文字列がリテラルになりました。正規表現は、次のようなパラメータを使用して構成する必要があります。
.defineRule().when(Path.matches("/{*}").where("*").matches(".*"))
私が得る例外は次のものです:
Exception starting filter OCPsoft Rewrite Filter
java.lang.NullPointerException
at org.ocpsoft.rewrite.servlet.config.rule.Join.where(Join.java:199)
at org.ocpsoft.rewrite.servlet.config.rule.Join.where(Join.java:47)
at com.myapp.util.RewriteConfigurationProvider.getConfiguration(RewriteConfigurationProvider.java:39)
...