Author: remy.maucherat(a)jboss.com
Date: 2007-07-18 20:56:09 -0400 (Wed, 18 Jul 2007)
New Revision: 196
Modified:
trunk/java/org/jboss/web/rewrite/RewriteValve.java
Log:
- Fix ornext parsing.
- Load rewrite configuration from conf/rewrite.properties if not found (?).
Modified: trunk/java/org/jboss/web/rewrite/RewriteValve.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/RewriteValve.java 2007-07-19 00:11:01 UTC (rev 195)
+++ trunk/java/org/jboss/web/rewrite/RewriteValve.java 2007-07-19 00:56:09 UTC (rev 196)
@@ -125,6 +125,9 @@
File file = new File(getConfigBase(), resourceName);
try {
if (!file.exists()) {
+ file = new File(getConfigBase(), resourcePath);
+ }
+ if (!file.exists()) {
if (resourceName != null) {
// Use getResource and getResourceAsStream
is = getClass().getClassLoader()
@@ -208,13 +211,19 @@
container.getLogger().debug("Add rule with pattern " +
rule.getPatternString()
+ " and substitution " +
rule.getSubstitutionString());
}
+ for (int i = (conditions.size() - 1); i > 0; i--) {
+ if (conditions.get(i - 1).isOrnext()) {
+ conditions.get(i).setOrnext(true);
+ }
+ }
for (int i = 0; i < conditions.size(); i++) {
if (container.getLogger().isDebugEnabled()) {
RewriteCond cond = conditions.get(i);
container.getLogger().debug("Add condition " +
cond.getCondPattern()
+ " test " + cond.getTestString() + "
to rule with pattern "
+ rule.getPatternString() + " and substitution
"
- + rule.getSubstitutionString());
+ + rule.getSubstitutionString() + (cond.isOrnext() ?
" [OR]" : "")
+ + (cond.isNocase() ? " [NC]" :
""));
}
rule.addCondition(conditions.get(i));
}
Show replies by date