JBossWeb SVN: r878 - branches.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2008-12-10 23:23:44 -0500 (Wed, 10 Dec 2008)
New Revision: 878
Added:
branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492/
Log:
Create JBPAPP-1492 patch branch from JBOSSWEB_2_0_0_GA_CP01 tag
Copied: branches/JBOSSWEB_2_0_0_GA_CP01_JBPAPP-1492 (from rev 877, tags/JBOSSWEB_2_0_0_GA_CP01)
16 years
JBossWeb SVN: r877 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-10 09:21:21 -0500 (Wed, 10 Dec 2008)
New Revision: 877
Modified:
trunk/PATCHES.txt
trunk/ROADMAP.txt
Log:
- Update patches and roadmap.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2008-12-08 12:10:50 UTC (rev 876)
+++ trunk/PATCHES.txt 2008-12-10 14:21:21 UTC (rev 877)
@@ -30,3 +30,7 @@
various
All changesets introducing generics, which have small value (new code or refactorings should use generics,
however)
+
+724886
+Executor modifications, very specialized work that breaks the Executor design (a single task can be submitted
+to the real executor more than once) to supposedly work better with the NIO connector
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2008-12-08 12:10:50 UTC (rev 876)
+++ trunk/ROADMAP.txt 2008-12-10 14:21:21 UTC (rev 877)
@@ -1,20 +1,22 @@
Roadmap for JBoss Web 3.0
+Main development:
+- Setup standalone TCK environment for testing compliance with the new features
- Implement Servlet 3.0 async for APR HTTP connector
- Update digester XML parsing rules for web.xml updates
- Implement new APIs for programmatic deployment descriptor access
-- Setup standalone TCK environment for testing compliance with the new features
- Implement annotation scanning for JBoss Web standalone (likely disabled by default using conf/web.xml)
- Implement any other Servlet 3.0 changes (web.xml fragments, security, etc)
-- Implement JSP 2.2 changes
- Implement Servlet 3.0 async for APR AJP connector
- Implement Servlet 3.0 async for java.io HTTP connector
- Implement Servlet 3.0 async for java.io AJP connector
+- Implement JSP 2.2 changes
+- Implement EL 1.1 changes
- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
- Coordinate with AS 6 for annotation updates (out of tree)
+
+Other:
- Diagnostic and monitoring features
-
-Other possible features:
- .net support like the php support (looks ok, but PHP is hard to use, how would this be different ?)
- fastcgi servlet (sounds useless)
- Java proxy (probably too many components needed to compete with mod_cluster, but a very basic HTTP proxy could be useful
16 years
JBossWeb SVN: r876 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-08 07:10:50 -0500 (Mon, 08 Dec 2008)
New Revision: 876
Modified:
trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
trunk/webapps/docs/changelog.xml
Log:
- JSSE configuration for SSL session options.
Modified: trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2008-12-05 17:07:59 UTC (rev 875)
+++ trunk/java/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2008-12-08 12:10:50 UTC (rev 876)
@@ -49,6 +49,7 @@
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSessionContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
@@ -88,6 +89,9 @@
private static final String defaultKeystoreFile
= System.getProperty("user.home") + "/.keystore";
private static final String defaultKeyPass = "changeit";
+ private static final int defaultSessionCacheSize = 0;
+ private static final int defaultSessionTimeout = 86400;
+
static org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(JSSESocketFactory.class);
@@ -413,6 +417,28 @@
trustAlgorithm),
new SecureRandom());
+ // Configure SSL session cache
+ int sessionCacheSize;
+ if (attributes.get("sessionCacheSize") != null) {
+ sessionCacheSize = Integer.parseInt(
+ (String)attributes.get("sessionCacheSize"));
+ } else {
+ sessionCacheSize = defaultSessionCacheSize;
+ }
+ int sessionCacheTimeout;
+ if (attributes.get("sessionCacheTimeout") != null) {
+ sessionCacheTimeout = Integer.parseInt(
+ (String)attributes.get("sessionCacheTimeout"));
+ } else {
+ sessionCacheTimeout = defaultSessionTimeout;
+ }
+ SSLSessionContext sessionContext =
+ context.getServerSessionContext();
+ if (sessionContext != null) {
+ sessionContext.setSessionCacheSize(sessionCacheSize);
+ sessionContext.setSessionTimeout(sessionCacheTimeout);
+ }
+
// create proxy
sslProxy = context.getServerSocketFactory();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-12-05 17:07:59 UTC (rev 875)
+++ trunk/webapps/docs/changelog.xml 2008-12-08 12:10:50 UTC (rev 876)
@@ -69,6 +69,13 @@
</update>
</changelog>
</subsection>
+ <subsection name="Coyote">
+ <changelog>
+ <fix>
+ JSSE configuration for SSL sessions. (markt)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Jasper">
<changelog>
<fix>
16 years
JBossWeb SVN: r875 - in trunk: java/org/jboss/web/rewrite and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-05 12:07:59 -0500 (Fri, 05 Dec 2008)
New Revision: 875
Modified:
trunk/java/org/apache/catalina/connector/Response.java
trunk/java/org/jboss/web/rewrite/RewriteRule.java
trunk/java/org/jboss/web/rewrite/RewriteValve.java
trunk/java/org/jboss/web/rewrite/Substitution.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/rewrite.xml
Log:
- Rewrite update to E and CO flags handling. Untested, will do later.
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/java/org/apache/catalina/connector/Response.java 2008-12-05 17:07:59 UTC (rev 875)
@@ -986,6 +986,23 @@
*
* @param cookie Cookie to be added
*/
+ public void addTomcatCookie(final TomcatCookie cookie) {
+
+ // Ignore any call from an included servlet
+ if (included)
+ return;
+
+ addCookieInternal(cookie);
+
+ }
+
+
+ /**
+ * Add the specified Cookie to those that will be included with
+ * this Response.
+ *
+ * @param cookie Cookie to be added
+ */
public void addCookieInternal(final Cookie cookie) {
if (isCommitted())
Modified: trunk/java/org/jboss/web/rewrite/RewriteRule.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/RewriteRule.java 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/java/org/jboss/web/rewrite/RewriteRule.java 2008-12-05 17:07:59 UTC (rev 875)
@@ -23,6 +23,7 @@
package org.jboss.web.rewrite;
+import java.util.ArrayList;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -54,6 +55,21 @@
for (int i = 0; i < conditions.length; i++) {
conditions[i].parse(maps);
}
+ // Parse flag which have substitution values
+ if (isEnv()) {
+ for (int i = 0; i < envValue.size(); i++) {
+ Substitution newEnvSubstitution = new Substitution();
+ newEnvSubstitution.setSub(envValue.get(i));
+ newEnvSubstitution.parse(maps);
+ envSubstitution.add(newEnvSubstitution);
+ envResult.add(new ThreadLocal<String>());
+ }
+ }
+ if (isCookie()) {
+ cookieSubstitution = new Substitution();
+ cookieSubstitution.setSub(cookieValue);
+ cookieSubstitution.parse(maps);
+ }
}
public void addCondition(RewriteCond condition) {
@@ -112,6 +128,14 @@
}
// Use the substitution to rewrite the url
if (rewrite) {
+ if (isEnv()) {
+ for (int i = 0; i < envSubstitution.size(); i++) {
+ envResult.get(i).set(envSubstitution.get(i).evaluate(matcher, lastMatcher, resolver));
+ }
+ }
+ if (isCookie()) {
+ cookieResult.set(cookieSubstitution.evaluate(matcher, lastMatcher, resolver));
+ }
if (substitution != null) {
return substitution.evaluate(matcher, lastMatcher, resolver);
} else {
@@ -153,19 +177,24 @@
protected boolean cookie = false;
protected String cookieName = null;
protected String cookieValue = null;
+ protected String cookieDomain = null;
+ protected int cookieLifetime = -1;
+ protected String cookiePath = null;
+ protected boolean cookieSecure = false;
+ protected boolean cookieHttpOnly = false;
+ protected Substitution cookieSubstitution = null;
+ protected ThreadLocal<String> cookieResult = new ThreadLocal<String>();
/**
- * This forces an environment variable named VAR to be set to the value VAL,
- * where VAL can contain regexp backreferences $N and %N which will be
- * expanded. You can use this flag more than once to set more than one variable.
- * The variables can be later dereferenced in many situations, but usually
- * from within XSSI (via <!--#echo var="VAR"-->) or CGI (e.g. $ENV{'VAR'}).
- * Additionally you can dereference it in a following RewriteCond pattern via
- * %{ENV:VAR}. Use this to strip but remember information from URLs.
+ * This forces a request attribute named VAR to be set to the value VAL,
+ * where VAL can contain regexp back references $N and %N which will be
+ * expanded. Multiple env flags are allowed.
*/
protected boolean env = false;
- protected String envName = null;
- protected String envValue = null;
+ protected ArrayList<String> envName = new ArrayList<String>();
+ protected ArrayList<String> envValue = new ArrayList<String>();
+ protected ArrayList<Substitution> envSubstitution = new ArrayList<Substitution>();
+ protected ArrayList<ThreadLocal<String>> envResult = new ArrayList<ThreadLocal<String>>();
/**
* This forces the current URL to be forbidden, i.e., it immediately sends
@@ -249,11 +278,11 @@
* module. Use this flag to achieve a more powerful implementation of the
* ProxyPass directive, to map some remote stuff into the namespace of
* the local server.
- * FIXME: Likely no impl for this, so replace with a redirect
+ * FIXME: No proxy
*/
/**
- * FIMXE: No passthrough ?
+ * FIXME: No passthrough ?
*/
/**
@@ -331,24 +360,33 @@
public void setCookieValue(String cookieValue) {
this.cookieValue = cookieValue;
}
+ public String getCookieResult() {
+ return cookieResult.get();
+ }
public boolean isEnv() {
return env;
}
+ public int getEnvSize() {
+ return envName.size();
+ }
public void setEnv(boolean env) {
this.env = env;
}
- public String getEnvName() {
- return envName;
+ public String getEnvName(int i) {
+ return envName.get(i);
}
- public void setEnvName(String envName) {
- this.envName = envName;
+ public void addEnvName(String envName) {
+ this.envName.add(envName);
}
- public String getEnvValue() {
- return envValue;
+ public String getEnvValue(int i) {
+ return envValue.get(i);
}
- public void setEnvValue(String envValue) {
- this.envValue = envValue;
+ public void addEnvValue(String envValue) {
+ this.envValue.add(envValue);
}
+ public String getEnvResult(int i) {
+ return envResult.get(i).get();
+ }
public boolean isForbidden() {
return forbidden;
}
@@ -457,5 +495,45 @@
public void setHost(boolean host) {
this.host = host;
}
+
+ public String getCookieDomain() {
+ return cookieDomain;
+ }
+
+ public void setCookieDomain(String cookieDomain) {
+ this.cookieDomain = cookieDomain;
+ }
+
+ public int getCookieLifetime() {
+ return cookieLifetime;
+ }
+
+ public void setCookieLifetime(int cookieLifetime) {
+ this.cookieLifetime = cookieLifetime;
+ }
+
+ public String getCookiePath() {
+ return cookiePath;
+ }
+
+ public void setCookiePath(String cookiePath) {
+ this.cookiePath = cookiePath;
+ }
+
+ public boolean isCookieSecure() {
+ return cookieSecure;
+ }
+
+ public void setCookieSecure(boolean cookieSecure) {
+ this.cookieSecure = cookieSecure;
+ }
+
+ public boolean isCookieHttpOnly() {
+ return cookieHttpOnly;
+ }
+
+ public void setCookieHttpOnly(boolean cookieHttpOnly) {
+ this.cookieHttpOnly = cookieHttpOnly;
+ }
}
Modified: trunk/java/org/jboss/web/rewrite/RewriteValve.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/RewriteValve.java 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/java/org/jboss/web/rewrite/RewriteValve.java 2008-12-05 17:07:59 UTC (rev 875)
@@ -53,6 +53,7 @@
import org.apache.catalina.valves.ValveBase;
import org.apache.tomcat.util.buf.CharChunk;
import org.apache.tomcat.util.buf.MessageBytes;
+import org.apache.tomcat.util.http.TomcatCookie;
import org.apache.tomcat.util.net.URL;
public class RewriteValve extends ValveBase
@@ -356,13 +357,20 @@
// - cookie
if (rules[i].isCookie() && newtest != null) {
- response.addCookie(new Cookie(rules[i].getCookieName(),
- rules[i].getCookieValue()));
- // FIXME: Cookie impl for other parameters
+ TomcatCookie cookie = new TomcatCookie(rules[i].getCookieName(),
+ rules[i].getCookieResult());
+ cookie.setDomain(rules[i].getCookieDomain());
+ cookie.setMaxAge(rules[i].getCookieLifetime());
+ cookie.setPath(rules[i].getCookiePath());
+ cookie.setSecure(rules[i].isCookieSecure());
+ cookie.setHttpOnly(rules[i].isCookieHttpOnly());
+ response.addCookie(cookie);
}
- // - env (note: this sets a system property)
+ // - env (note: this sets a request attribute)
if (rules[i].isEnv() && newtest != null) {
- System.setProperty(rules[i].getEnvName(), rules[i].getEnvValue());
+ for (int j = 0; j < rules[i].getEnvSize(); j++) {
+ request.setAttribute(rules[i].getEnvName(j), rules[i].getEnvResult(j));
+ }
}
// - content type (note: this will not force the content type, use a filter
// to do that)
@@ -614,12 +622,31 @@
} else if (flag.startsWith("C=")) {
flag = flag.substring("C=".length());
}
- int pos = flag.indexOf(':');
- if (pos == -1 || (pos + 1) == flag.length()) {
+ StringTokenizer tokenizer = new StringTokenizer(flag, ":");
+ if (tokenizer.countTokens() < 2) {
throw new IllegalArgumentException("Invalid flag in: " + line);
}
- rule.setCookieName(flag.substring(0, pos));
- rule.setCookieValue(flag.substring(pos + 1));
+ rule.setCookieName(tokenizer.nextToken());
+ rule.setCookieValue(tokenizer.nextToken());
+ if (tokenizer.hasMoreTokens()) {
+ rule.setCookieDomain(tokenizer.nextToken());
+ }
+ if (tokenizer.hasMoreTokens()) {
+ try {
+ rule.setCookieLifetime(Integer.parseInt(tokenizer.nextToken()));
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Invalid flag in: " + line, e);
+ }
+ }
+ if (tokenizer.hasMoreTokens()) {
+ rule.setCookiePath(tokenizer.nextToken());
+ }
+ if (tokenizer.hasMoreTokens()) {
+ rule.setCookieSecure(Boolean.parseBoolean(tokenizer.nextToken()));
+ }
+ if (tokenizer.hasMoreTokens()) {
+ rule.setCookieHttpOnly(Boolean.parseBoolean(tokenizer.nextToken()));
+ }
} else if (flag.startsWith("env=") || flag.startsWith("E=")) {
rule.setEnv(true);
if (flag.startsWith("env=")) {
@@ -631,8 +658,8 @@
if (pos == -1 || (pos + 1) == flag.length()) {
throw new IllegalArgumentException("Invalid flag in: " + line);
}
- rule.setEnvName(flag.substring(0, pos));
- rule.setEnvValue(flag.substring(pos + 1));
+ rule.addEnvName(flag.substring(0, pos));
+ rule.addEnvValue(flag.substring(pos + 1));
} else if (flag.startsWith("forbidden") || flag.startsWith("F")) {
rule.setForbidden(true);
} else if (flag.startsWith("gone") || flag.startsWith("G")) {
@@ -648,8 +675,7 @@
} else if (flag.startsWith("noescape") || flag.startsWith("NE")) {
rule.setNoescape(true);
} else if (flag.startsWith("proxy") || flag.startsWith("P")) {
- // FIXME: Proxy not supported at the moment, would require proxy
- // capabilities
+ // FIXME: Proxy not supported at the moment, would require proxy capabilities
//rule.setProxy(true);
} else if (flag.startsWith("qsappend") || flag.startsWith("QSA")) {
rule.setQsappend(true);
Modified: trunk/java/org/jboss/web/rewrite/Substitution.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/Substitution.java 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/java/org/jboss/web/rewrite/Substitution.java 2008-12-05 17:07:59 UTC (rev 875)
@@ -114,7 +114,6 @@
while (pos < sub.length()) {
percentPos = sub.indexOf('%', pos);
dollarPos = sub.indexOf('$', pos);
- // FIXME: System.out.println("S: " + sub + " pos: " + pos + " L: " + sub.length() + " %: " + percentPos + " $: " + dollarPos);
if (percentPos == -1 && dollarPos == -1) {
// Static text
StaticElement newElement = new StaticElement();
@@ -122,7 +121,7 @@
pos = sub.length();
elements.add(newElement);
} else if (percentPos == -1 || ((dollarPos != -1) && (dollarPos < percentPos))) {
- // $: backreference to rule or map lookup
+ // $: back reference to rule or map lookup
if (dollarPos + 1 == sub.length()) {
throw new IllegalArgumentException(sub);
}
@@ -134,7 +133,7 @@
elements.add(newElement);
}
if (Character.isDigit(sub.charAt(dollarPos + 1))) {
- // $: backreference to rule
+ // $: back reference to rule
RewriteRuleBackReferenceElement newElement = new RewriteRuleBackReferenceElement();
newElement.n = Character.digit(sub.charAt(dollarPos + 1), 10);
pos = dollarPos + 2;
@@ -166,7 +165,7 @@
elements.add(newElement);
}
} else {
- // %: backreference to cond or server variable
+ // %: back reference to condition or server variable
if (percentPos + 1 == sub.length()) {
throw new IllegalArgumentException(sub);
}
@@ -178,7 +177,7 @@
elements.add(newElement);
}
if (Character.isDigit(sub.charAt(percentPos + 1))) {
- // %: backreference to cond
+ // %: back reference to condition
RewriteCondBackReferenceElement newElement = new RewriteCondBackReferenceElement();
newElement.n = Character.digit(sub.charAt(percentPos + 1), 10);
pos = percentPos + 2;
@@ -224,130 +223,7 @@
}
/**
- * Create a substitution with the given string.
- */
- /*
- public Substitution(String sub, Map maps) {
- ArrayList elements = new ArrayList();
- int pos = 0;
- int percentPos = 0;
- int dollarPos = 0;
-
- while (pos < sub.length()) {
- percentPos = sub.indexOf('%', pos);
- dollarPos = sub.indexOf('$', pos);
- // FIXME: System.out.println("S: " + sub + " pos: " + pos + " L: " + sub.length() + " %: " + percentPos + " $: " + dollarPos);
- if (percentPos == -1 && dollarPos == -1) {
- // Static text
- StaticElement newElement = new StaticElement();
- newElement.value = sub.substring(pos, sub.length());
- pos = sub.length();
- elements.add(newElement);
- } else if (percentPos == -1 || ((dollarPos != -1) && (dollarPos < percentPos))) {
- // $: backreference to rule or map lookup
- if (dollarPos + 1 == sub.length()) {
- throw new IllegalArgumentException(sub);
- }
- if (pos < dollarPos) {
- // Static text
- StaticElement newElement = new StaticElement();
- newElement.value = sub.substring(pos, dollarPos);
- pos = dollarPos;
- elements.add(newElement);
- }
- if (Character.isDigit(sub.charAt(dollarPos + 1))) {
- // $: backreference to rule
- RewriteRuleBackReferenceElement newElement = new RewriteRuleBackReferenceElement();
- newElement.n = Character.digit(sub.charAt(dollarPos + 1), 10);
- pos = dollarPos + 2;
- elements.add(newElement);
- } else {
- // $: map lookup as ${mapname:key|default}
- MapElement newElement = new MapElement();
- int open = sub.indexOf('{', dollarPos);
- int colon = sub.indexOf(':', dollarPos);
- int def = sub.indexOf('|', dollarPos);
- int close = sub.indexOf('}', dollarPos);
- if (!(-1 < open && open < colon && colon < close)) {
- throw new IllegalArgumentException(sub);
- }
- newElement.map = (RewriteMap) maps.get(sub.substring(open + 1, colon));
- if (newElement.map == null) {
- throw new IllegalArgumentException(sub + ": No map: " + sub.substring(open + 1, colon));
- }
- if (def > -1) {
- if (!(colon < def && def < close)) {
- throw new IllegalArgumentException(sub);
- }
- newElement.key = sub.substring(colon + 1, def);
- newElement.defaultValue = sub.substring(def + 1, close);
- } else {
- newElement.key = sub.substring(colon + 1, close);
- }
- pos = close + 1;
- elements.add(newElement);
- }
- } else {
- // %: backreference to cond or server variable
- if (percentPos + 1 == sub.length()) {
- throw new IllegalArgumentException(sub);
- }
- if (pos < percentPos) {
- // Static text
- StaticElement newElement = new StaticElement();
- newElement.value = sub.substring(pos, percentPos);
- pos = percentPos;
- elements.add(newElement);
- }
- if (Character.isDigit(sub.charAt(percentPos + 1))) {
- // %: backreference to cond
- RewriteCondBackReferenceElement newElement = new RewriteCondBackReferenceElement();
- newElement.n = Character.digit(sub.charAt(percentPos + 1), 10);
- pos = percentPos + 2;
- elements.add(newElement);
- } else {
- // %: server variable as %{variable}
- SubstitutionElement newElement = null;
- int open = sub.indexOf('{', percentPos);
- int colon = sub.indexOf(':', percentPos);
- int close = sub.indexOf('}', percentPos);
- if (!(-1 < open && open < close)) {
- throw new IllegalArgumentException(sub);
- }
- if (colon > -1) {
- if (!(open < colon && colon < close)) {
- throw new IllegalArgumentException(sub);
- }
- String type = sub.substring(open + 1, colon);
- if (type.equals("ENV")) {
- newElement = new ServerVariableEnvElement();
- ((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
- } else if (type.equals("SSL")) {
- newElement = new ServerVariableSslElement();
- ((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
- } else if (type.equals("HTTP")) {
- newElement = new ServerVariableHttpElement();
- ((ServerVariableEnvElement) newElement).key = sub.substring(colon + 1, close);
- } else {
- throw new IllegalArgumentException(sub + ": Bad type: " + type);
- }
- } else {
- newElement = new ServerVariableElement();
- ((ServerVariableElement) newElement).key = sub.substring(open + 1, close);
- }
- pos = close + 1;
- elements.add(newElement);
- }
- }
- }
-
- this.elements = (SubstitutionElement[]) elements.toArray(new SubstitutionElement[0]);
-
- }
- */
-
- /**
- * Evaluate the substituation based on the context
+ * Evaluate the substitution based on the context
*
* @param rule corresponding matched rule
* @param cond last matched condition
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/webapps/docs/changelog.xml 2008-12-05 17:07:59 UTC (rev 875)
@@ -57,6 +57,16 @@
<add>
Add a log formatter which logs on one line. (markt)
</add>
+ <update>
+ <jira>129</jira>: Support substitution for cookies and env flags in RewriteRule, and map the env flag
+ to request attributes. (remm)
+ </update>
+ <update>
+ Support multiple env flags in RewriteRule. (remm)
+ </update>
+ <update>
+ Support all cookie flags in RewriteRule. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Jasper">
Modified: trunk/webapps/docs/rewrite.xml
===================================================================
--- trunk/webapps/docs/rewrite.xml 2008-12-05 17:07:03 UTC (rev 874)
+++ trunk/webapps/docs/rewrite.xml 2008-12-05 17:07:59 UTC (rev 875)
@@ -561,17 +561,11 @@
<li>
'<strong><code>env|E=</code></strong><em>VAR</em>:<em>VAL</em>'
(set <strong>e</strong>nvironment variable)<br />
- This forces an environment variable named <em>VAR</em> to
+ This forces a request attribute named <em>VAR</em> to
be set to the value <em>VAL</em>, where <em>VAL</em> can
contain regexp backreferences (<code>$N</code> and
<code>%N</code>) which will be expanded. You can use this
- flag more than once, to set more than one variable. The
- variables can later be dereferenced in many situations, most commonly
- from within XSSI (via <code><!--#echo
- var="VAR"--></code>) or CGI (<code>$ENV{'VAR'}</code>).
- You can also dereference the variable in a later RewriteCond pattern, using
- <code>%{ENV:VAR}</code>. Use this to strip
- information from URLs, while maintaining a record of that information.</li>
+ flag more than once, to set more than one variable.</li>
<li>'<strong><code>forbidden|F</code></strong>' (force URL
to be <strong>f</strong>orbidden)<br />
16 years
JBossWeb SVN: r874 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-05 12:07:03 -0500 (Fri, 05 Dec 2008)
New Revision: 874
Modified:
trunk/ROADMAP.txt
Log:
- Update roadmap.
Modified: trunk/ROADMAP.txt
===================================================================
--- trunk/ROADMAP.txt 2008-12-05 04:51:05 UTC (rev 873)
+++ trunk/ROADMAP.txt 2008-12-05 17:07:03 UTC (rev 874)
@@ -3,6 +3,7 @@
- Implement Servlet 3.0 async for APR HTTP connector
- Update digester XML parsing rules for web.xml updates
- Implement new APIs for programmatic deployment descriptor access
+- Setup standalone TCK environment for testing compliance with the new features
- Implement annotation scanning for JBoss Web standalone (likely disabled by default using conf/web.xml)
- Implement any other Servlet 3.0 changes (web.xml fragments, security, etc)
- Implement JSP 2.2 changes
@@ -11,3 +12,10 @@
- Implement Servlet 3.0 async for java.io AJP connector
- Coordinate with AS 6 to implement new web.xml parsing (out of tree)
- Coordinate with AS 6 for annotation updates (out of tree)
+- Diagnostic and monitoring features
+
+Other possible features:
+- .net support like the php support (looks ok, but PHP is hard to use, how would this be different ?)
+- fastcgi servlet (sounds useless)
+- Java proxy (probably too many components needed to compete with mod_cluster, but a very basic HTTP proxy could be useful
+ for the rewrite valve)
16 years
JBossWeb SVN: r873 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/net.
by jbossweb-commits@lists.jboss.org
Author: dstephan
Date: 2008-12-04 23:51:05 -0500 (Thu, 04 Dec 2008)
New Revision: 873
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
Log:
JBPAPP-1470 - Backporting revision 214 to EAP CP.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2008-12-04 14:54:59 UTC (rev 872)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2008-12-05 04:51:05 UTC (rev 873)
@@ -725,14 +725,6 @@
workers = new WorkerStack(maxThreads);
}
- // Start acceptor threads
- for (int i = 0; i < acceptorThreadCount; i++) {
- Thread acceptorThread = new Thread(new Acceptor(), getName() + "-Acceptor-" + i);
- acceptorThread.setPriority(threadPriority);
- acceptorThread.setDaemon(daemon);
- acceptorThread.start();
- }
-
// Start poller threads
pollers = new Poller[pollerThreadCount];
for (int i = 0; i < pollerThreadCount; i++) {
@@ -767,6 +759,14 @@
sendfileThread.start();
}
}
+
+ // Start acceptor threads
+ for (int i = 0; i < acceptorThreadCount; i++) {
+ Thread acceptorThread = new Thread(new Acceptor(), getName() + "-Acceptor-" + i);
+ acceptorThread.setPriority(threadPriority);
+ acceptorThread.setDaemon(daemon);
+ acceptorThread.start();
+ }
}
}
16 years
JBossWeb SVN: r871 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-01 08:41:04 -0500 (Mon, 01 Dec 2008)
New Revision: 871
Added:
trunk/java/org/apache/juli/OneLineFormatter.java
Modified:
trunk/webapps/docs/changelog.xml
Log:
- Add one line log formatter.
Added: trunk/java/org/apache/juli/OneLineFormatter.java
===================================================================
--- trunk/java/org/apache/juli/OneLineFormatter.java (rev 0)
+++ trunk/java/org/apache/juli/OneLineFormatter.java 2008-12-01 13:41:04 UTC (rev 871)
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juli;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+/**
+ * Provides same information as default log format but on a single line to make
+ * it easier to grep the logs. The only exception is stack traces which are
+ * always preceded by whitespace to make it simple to skip them.
+ */
+/*
+ * Date processing based on AccessLogValve.
+ */
+public class OneLineFormatter extends Formatter {
+
+ /**
+ * The set of month abbreviations for log messages.
+ */
+ private static final String months[] = {"Jan", "Feb", "Mar", "Apr", "May",
+ "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
+
+ private static final String LINE_SEP = System.getProperty("line.separator");
+ private static final String ST_SEP = LINE_SEP + " ";
+
+ private final SimpleDateFormat dayFormatter = new SimpleDateFormat("dd");
+ private final SimpleDateFormat monthFormatter = new SimpleDateFormat("MM");
+ private final SimpleDateFormat yearFormatter = new SimpleDateFormat("yyyy");
+ private final SimpleDateFormat timeFormatter =
+ new SimpleDateFormat("hh:mm:ss");
+
+ private Date currentDate;
+ private String currentDateString;
+
+ @Override
+ public String format(LogRecord record) {
+ StringBuffer sb = new StringBuffer();
+
+ // Timestamp
+ addTimestamp(sb, new Date(record.getMillis()));
+
+ // Severity
+ sb.append(' ');
+ sb.append(record.getLevel());
+
+ // Source
+ sb.append(' ');
+ sb.append(record.getSourceClassName());
+ sb.append('.');
+ sb.append(record.getSourceMethodName());
+
+ // Message
+ sb.append(' ');
+ sb.append(record.getMessage());
+
+ // Stack trace
+ if (record.getThrown() != null) {
+ sb.append(ST_SEP);
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ record.getThrown().printStackTrace(pw);
+ pw.close();
+ sb.append(sw.getBuffer());
+ }
+
+ // New line for next record
+ sb.append(LINE_SEP);
+
+ return sb.toString();
+ }
+
+ public void addTimestamp(StringBuffer buf, Date date) {
+ if (currentDate != date) {
+ synchronized (this) {
+ if (currentDate != date) {
+ StringBuffer current = new StringBuffer(32);
+ current.append(dayFormatter.format(date)); // Day
+ current.append('-');
+ current.append(lookup(monthFormatter.format(date))); // Month
+ current.append('-');
+ current.append(yearFormatter.format(date)); // Year
+ current.append(' ');
+ current.append(timeFormatter.format(date)); // Time
+ currentDateString = current.toString();
+ currentDate = date;
+ }
+ }
+ }
+ buf.append(currentDateString);
+ }
+
+ /**
+ * Return the month abbreviation for the specified month, which must
+ * be a two-digit String.
+ *
+ * @param month Month number ("01" .. "12").
+ */
+ private String lookup(String month) {
+ int index;
+ try {
+ index = Integer.parseInt(month) - 1;
+ } catch (Throwable t) {
+ index = 0; // Can not happen, in theory
+ }
+ return (months[index]);
+ }
+}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-12-01 13:37:34 UTC (rev 870)
+++ trunk/webapps/docs/changelog.xml 2008-12-01 13:41:04 UTC (rev 871)
@@ -54,6 +54,9 @@
<fix>
InstanceManager security manager fixes. (markt)
</fix>
+ <add>
+ Add a log formatter which logs on one line. (markt)
+ </add>
</changelog>
</subsection>
<subsection name="Jasper">
16 years
JBossWeb SVN: r870 - in trunk: conf and 4 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-12-01 08:37:34 -0500 (Mon, 01 Dec 2008)
New Revision: 870
Modified:
trunk/PATCHES.txt
trunk/conf/catalina.policy
trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
trunk/java/org/apache/catalina/security/SecurityClassLoad.java
trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
trunk/webapps/docs/changelog.xml
Log:
- Various security manager fixes.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/PATCHES.txt 2008-12-01 13:37:34 UTC (rev 870)
@@ -26,3 +26,7 @@
720728
Multiple pollers, which adds the complexity of needing a map to track to which poller a connection belongs
(needed in IO event mode). There are 3 pollers already, which should be able to handle a lot of traffic.
+
+various
+All changesets introducing generics, which have small value (new code or refactorings should use generics,
+however)
Modified: trunk/conf/catalina.policy
===================================================================
--- trunk/conf/catalina.policy 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/conf/catalina.policy 2008-12-01 13:37:34 UTC (rev 870)
@@ -1,5 +1,20 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
// ============================================================================
-// catalina.corepolicy - Security Policy Permissions for Tomcat 5
+// catalina.corepolicy - Security Policy Permissions for JBoss Web
//
// This file contains a default set of security policies to be enforced (by the
// JVM) when Catalina is executed with the "-security" option. In addition
@@ -49,7 +64,7 @@
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
permission java.util.PropertyPermission "java.util.logging.config.class", "read";
permission java.util.PropertyPermission "java.util.logging.config.file", "read";
- permission java.io.FilePermission "${java.home}${file.separator}lib${file.separator}logging.properties", "read";
+ permission java.io.FilePermission "${java.home}${file.separator}lib${file.separator}logging.properties", "read";
permission java.lang.RuntimePermission "shutdownHooks";
permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
permission java.util.PropertyPermission "catalina.base", "read";
@@ -102,27 +117,31 @@
permission java.util.PropertyPermission "java.vendor", "read";
permission java.util.PropertyPermission "java.vendor.url", "read";
permission java.util.PropertyPermission "java.class.version", "read";
- permission java.util.PropertyPermission "java.specification.version", "read";
- permission java.util.PropertyPermission "java.specification.vendor", "read";
- permission java.util.PropertyPermission "java.specification.name", "read";
+ permission java.util.PropertyPermission "java.specification.version", "read";
+ permission java.util.PropertyPermission "java.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.specification.name", "read";
- permission java.util.PropertyPermission "java.vm.specification.version", "read";
- permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
- permission java.util.PropertyPermission "java.vm.specification.name", "read";
- permission java.util.PropertyPermission "java.vm.version", "read";
- permission java.util.PropertyPermission "java.vm.vendor", "read";
- permission java.util.PropertyPermission "java.vm.name", "read";
+ permission java.util.PropertyPermission "java.vm.specification.version", "read";
+ permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.specification.name", "read";
+ permission java.util.PropertyPermission "java.vm.version", "read";
+ permission java.util.PropertyPermission "java.vm.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.name", "read";
// Required for OpenJMX
permission java.lang.RuntimePermission "getAttribute";
- // Allow read of JAXP compliant XML parser debug
- permission java.util.PropertyPermission "jaxp.debug", "read";
+ // Allow read of JAXP compliant XML parser debug
+ permission java.util.PropertyPermission "jaxp.debug", "read";
- // Precompiled JSPs need access to this package.
+ // Precompiled JSPs need access to these packages.
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*";
+ // Precompiled JSPs need access to these system properties.
+ permission java.util.PropertyPermission "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
+ permission java.util.PropertyPermission "org.apache.el.parser.COERCE_TO_ZERO", "read";
};
Modified: trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
===================================================================
--- trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/java/org/apache/catalina/core/DefaultInstanceManager.java 2008-12-01 13:37:34 UTC (rev 870)
@@ -52,7 +52,7 @@
import org.apache.catalina.util.StringManager;
/**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
*/
public class DefaultInstanceManager implements InstanceManager {
@@ -205,14 +205,24 @@
* @throws java.lang.reflect.InvocationTargetException
* if call fails
*/
- protected void preDestroy(Object instance, Class<?> clazz)
+ protected void preDestroy(Object instance, final Class<?> clazz)
throws IllegalAccessException, InvocationTargetException {
Class<?> superClass = clazz.getSuperclass();
if (superClass != Object.class) {
preDestroy(instance, superClass);
}
- Method[] methods = clazz.getDeclaredMethods();
+ Method[] methods;
+ if (Globals.IS_SECURITY_ENABLED) {
+ methods = AccessController.doPrivileged(
+ new PrivilegedAction<Method[]>(){
+ public Method[] run(){
+ return clazz.getDeclaredMethods();
+ }
+ });
+ } else {
+ methods = clazz.getDeclaredMethods();
+ }
Method preDestroy = null;
for (Method method : methods) {
if (method.isAnnotationPresent(PreDestroy.class)) {
Modified: trunk/java/org/apache/catalina/security/SecurityClassLoad.java
===================================================================
--- trunk/java/org/apache/catalina/security/SecurityClassLoad.java 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/java/org/apache/catalina/security/SecurityClassLoad.java 2008-12-01 13:37:34 UTC (rev 870)
@@ -64,6 +64,21 @@
"core.ContainerBase$PrivilegedAddChild");
loader.loadClass
(basePackage +
+ "core.DefaultInstanceManager$1");
+ loader.loadClass
+ (basePackage +
+ "core.DefaultInstanceManager$2");
+ loader.loadClass
+ (basePackage +
+ "core.DefaultInstanceManager$3");
+ loader.loadClass
+ (basePackage +
+ "core.DefaultInstanceManager$4");
+ loader.loadClass
+ (basePackage +
+ "core.DefaultInstanceManager$5");
+ loader.loadClass
+ (basePackage +
"core.ApplicationHttpRequest$AttributeNamesEnumerator");
}
Modified: trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 2008-12-01 13:37:34 UTC (rev 870)
@@ -16,6 +16,8 @@
*/
package org.apache.jasper.runtime;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -37,6 +39,7 @@
import javax.servlet.jsp.el.ScopedAttributeELResolver;
import org.apache.el.ExpressionFactoryImpl;
+import org.apache.jasper.Constants;
import org.apache.jasper.el.ELContextImpl;
/**
@@ -88,8 +91,18 @@
}
// create ELContext for JspContext
- ELResolver r = this.createELResolver();
- ELContextImpl ctx = new ELContextImpl(r);
+ final ELResolver r = this.createELResolver();
+ ELContextImpl ctx;
+ if (Constants.IS_SECURITY_ENABLED) {
+ ctx = AccessController.doPrivileged(
+ new PrivilegedAction<ELContextImpl>() {
+ public ELContextImpl run() {
+ return new ELContextImpl(r);
+ }
+ });
+ } else {
+ ctx = new ELContextImpl(r);
+ }
ctx.putContext(JspContext.class, context);
// alert all ELContextListeners
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-11-28 16:17:45 UTC (rev 869)
+++ trunk/webapps/docs/changelog.xml 2008-12-01 13:37:34 UTC (rev 870)
@@ -51,8 +51,18 @@
<fix>
Possible NPE on shutdown of ClusterListener. (remm)
</fix>
+ <fix>
+ InstanceManager security manager fixes. (markt)
+ </fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ EL security manager fixes. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 2.1.1.GA (remm)">
16 years