JBossWeb SVN: r737 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-08-05 09:10:55 -0400 (Tue, 05 Aug 2008)
New Revision: 737
Added:
tags/JBOSSWEB_2_0_0_GA_CP07/
Log:
- 2.0.0.GA.CP07.
Copied: tags/JBOSSWEB_2_0_0_GA_CP07 (from rev 736, branches/JBOSSWEB_2_0_0_GA_CP)
15 years, 9 months
JBossWeb SVN: r736 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-08-04 11:11:26 -0400 (Mon, 04 Aug 2008)
New Revision: 736
Modified:
trunk/java/org/apache/el/parser/ELParser.java
trunk/java/org/apache/el/parser/ELParser.jjt
trunk/java/org/apache/el/parser/ELParserConstants.java
trunk/java/org/apache/el/parser/ELParserTokenManager.java
trunk/webapps/docs/changelog.xml
Log:
- Port another EL parser update.
Modified: trunk/java/org/apache/el/parser/ELParser.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.java 2008-08-04 12:02:57 UTC (rev 735)
+++ trunk/java/org/apache/el/parser/ELParser.java 2008-08-04 15:11:26 UTC (rev 736)
@@ -963,7 +963,6 @@
case NULL:
case LPAREN:
case IDENTIFIER:
- case FUNCTION_CALL:
Value();
break;
default:
@@ -1033,7 +1032,6 @@
break;
case LPAREN:
case IDENTIFIER:
- case FUNCTION_CALL:
NonLiteral();
break;
default:
@@ -1131,7 +1129,7 @@
break;
default:
jj_la1[28] = jj_gen;
- if (jj_2_1(3)) {
+ if (jj_2_1(2147483647)) {
Function();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1176,10 +1174,27 @@
/*@bgen(jjtree) Function */
AstFunction jjtn000 = new AstFunction(JJTFUNCTION);
boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);Token tx = null;
+ jjtree.openNodeScope(jjtn000);Token t0 = null;
+ Token t1 = null;
try {
- tx = jj_consume_token(FUNCTION_CALL);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case IDENTIFIER:
+ t0 = jj_consume_token(IDENTIFIER);
+ jj_consume_token(COLON);
+ break;
+ default:
+ jj_la1[30] = jj_gen;
+ ;
+ }
+ t1 = jj_consume_token(IDENTIFIER);
+ if (t0 != null) {
+ jjtn000.setPrefix(t0.image.substring(0, t0.image.length() - 1));
+ jjtn000.setLocalName(t1.image);
+ } else {
+ jjtn000.setLocalName(t1.image);
+ }
+ jj_consume_token(LPAREN);
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case INTEGER_LITERAL:
case FLOATING_POINT_LITERAL:
case STRING_LITERAL:
@@ -1192,7 +1207,6 @@
case EMPTY:
case MINUS:
case IDENTIFIER:
- case FUNCTION_CALL:
Expression();
label_10:
while (true) {
@@ -1201,7 +1215,7 @@
;
break;
default:
- jj_la1[30] = jj_gen;
+ jj_la1[31] = jj_gen;
break label_10;
}
jj_consume_token(COMMA);
@@ -1209,19 +1223,10 @@
}
break;
default:
- jj_la1[31] = jj_gen;
+ jj_la1[32] = jj_gen;
;
}
jj_consume_token(RPAREN);
- jjtree.closeNodeScope(jjtn000, true);
- jjtc000 = false;
- int split = tx.image.indexOf(":");
- if (split!=-1) {
- jjtn000.setPrefix(tx.image.substring(0, split));
- jjtn000.setLocalName(tx.image.substring(split + 1, tx.image.length() - 1));
- } else {
- jjtn000.setLocalName(tx.image.substring(0, tx.image.length() - 1));
- }
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
@@ -1266,7 +1271,7 @@
Null();
break;
default:
- jj_la1[32] = jj_gen;
+ jj_la1[33] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
@@ -1303,7 +1308,7 @@
}
break;
default:
- jj_la1[33] = jj_gen;
+ jj_la1[34] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
@@ -1398,500 +1403,20 @@
}
final private boolean jj_3R_11() {
- if (jj_scan_token(FUNCTION_CALL)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_12()) jj_scanpos = xsp;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- final private boolean jj_3R_28() {
- if (jj_3R_34()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_35()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_37() {
- if (jj_scan_token(MINUS)) return true;
- return false;
- }
-
- final private boolean jj_3R_29() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_36()) {
- jj_scanpos = xsp;
- if (jj_3R_37()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_36() {
- if (jj_scan_token(PLUS)) return true;
- return false;
- }
-
- final private boolean jj_3R_69() {
if (jj_scan_token(IDENTIFIER)) return true;
+ if (jj_scan_token(COLON)) return true;
return false;
}
- final private boolean jj_3R_61() {
- if (jj_3R_69()) return true;
- return false;
- }
-
- final private boolean jj_3R_24() {
- if (jj_3R_28()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_29()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
final private boolean jj_3_1() {
- if (jj_3R_11()) return true;
- return false;
- }
-
- final private boolean jj_3R_33() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(29)) {
- jj_scanpos = xsp;
- if (jj_scan_token(30)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_60() {
+ if (jj_3R_11()) jj_scanpos = xsp;
+ if (jj_scan_token(IDENTIFIER)) return true;
if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_13()) return true;
return false;
}
- final private boolean jj_3R_52() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_60()) {
- jj_scanpos = xsp;
- if (jj_3_1()) {
- jj_scanpos = xsp;
- if (jj_3R_61()) return true;
- }
- }
- return false;
- }
-
- final private boolean jj_3R_32() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) {
- jj_scanpos = xsp;
- if (jj_scan_token(32)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_31() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(25)) {
- jj_scanpos = xsp;
- if (jj_scan_token(26)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_68() {
- if (jj_scan_token(NULL)) return true;
- return false;
- }
-
- final private boolean jj_3R_25() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_30()) {
- jj_scanpos = xsp;
- if (jj_3R_31()) {
- jj_scanpos = xsp;
- if (jj_3R_32()) {
- jj_scanpos = xsp;
- if (jj_3R_33()) return true;
- }
- }
- }
- return false;
- }
-
- final private boolean jj_3R_30() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(27)) {
- jj_scanpos = xsp;
- if (jj_scan_token(28)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_63() {
- if (jj_scan_token(LBRACK)) return true;
- return false;
- }
-
- final private boolean jj_3R_67() {
- if (jj_scan_token(STRING_LITERAL)) return true;
- return false;
- }
-
- final private boolean jj_3R_54() {
- if (jj_3R_63()) return true;
- return false;
- }
-
- final private boolean jj_3R_22() {
- if (jj_3R_24()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_25()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_27() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(35)) {
- jj_scanpos = xsp;
- if (jj_scan_token(36)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_62() {
- if (jj_scan_token(DOT)) return true;
- return false;
- }
-
- final private boolean jj_3R_26() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(33)) {
- jj_scanpos = xsp;
- if (jj_scan_token(34)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_23() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_26()) {
- jj_scanpos = xsp;
- if (jj_3R_27()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_66() {
- if (jj_scan_token(INTEGER_LITERAL)) return true;
- return false;
- }
-
- final private boolean jj_3R_21() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(39)) {
- jj_scanpos = xsp;
- if (jj_scan_token(40)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_53() {
- if (jj_3R_62()) return true;
- return false;
- }
-
- final private boolean jj_3R_50() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_53()) {
- jj_scanpos = xsp;
- if (jj_3R_54()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_20() {
- if (jj_3R_22()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_23()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_47() {
- if (jj_3R_50()) return true;
- return false;
- }
-
- final private boolean jj_3R_65() {
- if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
- return false;
- }
-
- final private boolean jj_3R_49() {
- if (jj_3R_52()) return true;
- return false;
- }
-
- final private boolean jj_3R_14() {
- if (jj_scan_token(COMMA)) return true;
- return false;
- }
-
- final private boolean jj_3R_71() {
- if (jj_scan_token(FALSE)) return true;
- return false;
- }
-
- final private boolean jj_3R_48() {
- if (jj_3R_51()) return true;
- return false;
- }
-
- final private boolean jj_3R_46() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_48()) {
- jj_scanpos = xsp;
- if (jj_3R_49()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_18() {
- if (jj_3R_20()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_21()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_19() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(41)) {
- jj_scanpos = xsp;
- if (jj_scan_token(42)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_70() {
- if (jj_scan_token(TRUE)) return true;
- return false;
- }
-
- final private boolean jj_3R_64() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_70()) {
- jj_scanpos = xsp;
- if (jj_3R_71()) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_45() {
- if (jj_3R_46()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_47()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_16() {
- if (jj_3R_18()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_19()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_41() {
- if (jj_3R_45()) return true;
- return false;
- }
-
- final private boolean jj_3R_59() {
- if (jj_3R_68()) return true;
- return false;
- }
-
- final private boolean jj_3R_58() {
- if (jj_3R_67()) return true;
- return false;
- }
-
- final private boolean jj_3R_17() {
- if (jj_scan_token(QUESTIONMARK)) return true;
- return false;
- }
-
- final private boolean jj_3R_40() {
- if (jj_scan_token(EMPTY)) return true;
- if (jj_3R_34()) return true;
- return false;
- }
-
- final private boolean jj_3R_57() {
- if (jj_3R_66()) return true;
- return false;
- }
-
- final private boolean jj_3R_12() {
- if (jj_3R_13()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_14()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_56() {
- if (jj_3R_65()) return true;
- return false;
- }
-
- final private boolean jj_3R_39() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(37)) {
- jj_scanpos = xsp;
- if (jj_scan_token(38)) return true;
- }
- if (jj_3R_34()) return true;
- return false;
- }
-
- final private boolean jj_3R_34() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_38()) {
- jj_scanpos = xsp;
- if (jj_3R_39()) {
- jj_scanpos = xsp;
- if (jj_3R_40()) {
- jj_scanpos = xsp;
- if (jj_3R_41()) return true;
- }
- }
- }
- return false;
- }
-
- final private boolean jj_3R_38() {
- if (jj_scan_token(MINUS)) return true;
- if (jj_3R_34()) return true;
- return false;
- }
-
- final private boolean jj_3R_55() {
- if (jj_3R_64()) return true;
- return false;
- }
-
- final private boolean jj_3R_51() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_55()) {
- jj_scanpos = xsp;
- if (jj_3R_56()) {
- jj_scanpos = xsp;
- if (jj_3R_57()) {
- jj_scanpos = xsp;
- if (jj_3R_58()) {
- jj_scanpos = xsp;
- if (jj_3R_59()) return true;
- }
- }
- }
- }
- return false;
- }
-
- final private boolean jj_3R_15() {
- if (jj_3R_16()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_17()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- final private boolean jj_3R_44() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(51)) {
- jj_scanpos = xsp;
- if (jj_scan_token(52)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_13() {
- if (jj_3R_15()) return true;
- return false;
- }
-
- final private boolean jj_3R_43() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(49)) {
- jj_scanpos = xsp;
- if (jj_scan_token(50)) return true;
- }
- return false;
- }
-
- final private boolean jj_3R_35() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_42()) {
- jj_scanpos = xsp;
- if (jj_3R_43()) {
- jj_scanpos = xsp;
- if (jj_3R_44()) return true;
- }
- }
- return false;
- }
-
- final private boolean jj_3R_42() {
- if (jj_scan_token(MULT)) return true;
- return false;
- }
-
public ELParserTokenManager token_source;
SimpleCharStream jj_input_stream;
public Token token, jj_nt;
@@ -1901,7 +1426,7 @@
public boolean lookingAhead = false;
private boolean jj_semLA;
private int jj_gen;
- final private int[] jj_la1 = new int[34];
+ final private int[] jj_la1 = new int[35];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
@@ -1909,10 +1434,10 @@
jj_la1_1();
}
private static void jj_la1_0() {
- jj_la1_0 = new int[] {0xe,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfe000000,0x18000000,0x6000000,0x80000000,0x60000000,0xfe000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9d600,0x240000,0x9d600,0x240000,0x80000,0x0,0x1000000,0x9d600,0x1d600,0xc000,};
+ jj_la1_0 = new int[] {0xe,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfe000000,0x18000000,0x6000000,0x80000000,0x60000000,0xfe000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9d600,0x240000,0x9d600,0x240000,0x80000,0x0,0x0,0x1000000,0x9d600,0x1d600,0xc000,};
}
private static void jj_la1_1() {
- jj_la1_1 = new int[] {0x0,0x0,0x10000,0x600,0x600,0x180,0x180,0x1e,0x6,0x18,0x1e,0x1,0x0,0x0,0x1,0x0,0x1,0xc000,0xc000,0x1e2000,0x60000,0x180000,0x1e2000,0x60,0x1208860,0x0,0x1200000,0x0,0x0,0x200000,0x0,0x1208860,0x0,0x0,};
+ jj_la1_1 = new int[] {0x0,0x0,0x10000,0x600,0x600,0x180,0x180,0x1e,0x6,0x18,0x1e,0x1,0x0,0x0,0x1,0x0,0x1,0xc000,0xc000,0x1e2000,0x60000,0x180000,0x1e2000,0x60,0x208860,0x0,0x200000,0x0,0x0,0x200000,0x200000,0x0,0x208860,0x0,0x0,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[1];
private boolean jj_rescan = false;
@@ -1927,7 +1452,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -1941,7 +1466,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -1951,7 +1476,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -1962,7 +1487,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -1971,7 +1496,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -1981,7 +1506,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 34; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 35; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2092,15 +1617,15 @@
public ParseException generateParseException() {
jj_expentries.removeAllElements();
- boolean[] la1tokens = new boolean[62];
- for (int i = 0; i < 62; i++) {
+ boolean[] la1tokens = new boolean[59];
+ for (int i = 0; i < 59; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
- for (int i = 0; i < 34; i++) {
+ for (int i = 0; i < 35; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1<<j)) != 0) {
@@ -2112,7 +1637,7 @@
}
}
}
- for (int i = 0; i < 62; i++) {
+ for (int i = 0; i < 59; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
Modified: trunk/java/org/apache/el/parser/ELParser.jjt
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.jjt 2008-08-04 12:02:57 UTC (rev 735)
+++ trunk/java/org/apache/el/parser/ELParser.jjt 2008-08-04 15:11:26 UTC (rev 736)
@@ -31,7 +31,7 @@
NODE_DEFAULT_VOID=true;
JAVA_UNICODE_ESCAPE=false;
UNICODE_INPUT=true;
- BUILD_NODE_FILES=false;
+ BUILD_NODE_FILES=true;
}
/* == Parser Declaration == */
@@ -255,7 +255,7 @@
void NonLiteral() : {}
{
<LPAREN> Expression() <RPAREN>
- | LOOKAHEAD(3) Function()
+ | LOOKAHEAD((<IDENTIFIER> <COLON>)? <IDENTIFIER> <LPAREN>) Function()
| Identifier()
}
@@ -274,19 +274,20 @@
*/
void Function() #Function :
{
- Token tx = null;
+ Token t0 = null;
+ Token t1 = null;
}
{
- (tx=<FUNCTION_CALL>) (Expression() (<COMMA> Expression())*)? <RPAREN>
+ (t0=<IDENTIFIER> <COLON>)? t1=<IDENTIFIER>
{
- int split = tx.image.indexOf(":");
- if (split!=-1) {
- jjtThis.setPrefix(tx.image.substring(0, split));
- jjtThis.setLocalName(tx.image.substring(split + 1, tx.image.length() - 1));
+ if (t0 != null) {
+ jjtThis.setPrefix(t0.image.substring(0, t0.image.length() - 1));
+ jjtThis.setLocalName(t1.image);
} else {
- jjtThis.setLocalName(tx.image.substring(0, tx.image.length() - 1));
+ jjtThis.setLocalName(t1.image);
}
}
+ <LPAREN> (Expression() (<COMMA> Expression())*)? <RPAREN>
}
/*
@@ -427,9 +428,6 @@
| < MOD0 : "%" >
| < MOD1 : "mod" >
| < IDENTIFIER : (<LETTER>|<IMPL_OBJ_START>) (<LETTER>|<DIGIT>)* >
-| < #NAMESPACE : ( <NAMESPACE_NAME> <COLON>) >
-| < #NAMESPACE_NAME: (<IDENTIFIER> (<LETTER>|<DIGIT>|<MINUS>|<DOT>)*) >
-| < FUNCTION_CALL: (<NAMESPACE>)? <IDENTIFIER> <LPAREN> >
| < FUNCTIONSUFFIX : (<IDENTIFIER>) >
| < #IMPL_OBJ_START: "#" >
| < #LETTER:
Modified: trunk/java/org/apache/el/parser/ELParserConstants.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParserConstants.java 2008-08-04 12:02:57 UTC (rev 735)
+++ trunk/java/org/apache/el/parser/ELParserConstants.java 2008-08-04 15:11:26 UTC (rev 736)
@@ -68,14 +68,11 @@
int MOD0 = 51;
int MOD1 = 52;
int IDENTIFIER = 53;
- int NAMESPACE = 54;
- int NAMESPACE_NAME = 55;
- int FUNCTION_CALL = 56;
- int FUNCTIONSUFFIX = 57;
- int IMPL_OBJ_START = 58;
- int LETTER = 59;
- int DIGIT = 60;
- int ILLEGAL_CHARACTER = 61;
+ int FUNCTIONSUFFIX = 54;
+ int IMPL_OBJ_START = 55;
+ int LETTER = 56;
+ int DIGIT = 57;
+ int ILLEGAL_CHARACTER = 58;
int DEFAULT = 0;
int IN_EXPRESSION = 1;
@@ -135,9 +132,6 @@
"\"%\"",
"\"mod\"",
"<IDENTIFIER>",
- "<NAMESPACE>",
- "<NAMESPACE_NAME>",
- "<FUNCTION_CALL>",
"<FUNCTIONSUFFIX>",
"\"#\"",
"<LETTER>",
Modified: trunk/java/org/apache/el/parser/ELParserTokenManager.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParserTokenManager.java 2008-08-04 12:02:57 UTC (rev 735)
+++ trunk/java/org/apache/el/parser/ELParserTokenManager.java 2008-08-04 15:11:26 UTC (rev 736)
@@ -299,22 +299,22 @@
switch (pos)
{
case 0:
+ if ((active0 & 0x40000L) != 0L)
+ return 1;
if ((active0 & 0x141d555401c000L) != 0L)
{
jjmatchedKind = 53;
- return 42;
+ return 36;
}
- if ((active0 & 0x40000L) != 0L)
- return 1;
return -1;
case 1:
if ((active0 & 0x41554000000L) != 0L)
- return 42;
+ return 36;
if ((active0 & 0x1419400001c000L) != 0L)
{
jjmatchedKind = 53;
jjmatchedPos = 1;
- return 42;
+ return 36;
}
return -1;
case 2:
@@ -322,29 +322,29 @@
{
jjmatchedKind = 53;
jjmatchedPos = 2;
- return 42;
+ return 36;
}
if ((active0 & 0x14014000000000L) != 0L)
- return 42;
+ return 36;
return -1;
case 3:
+ if ((active0 & 0x14000L) != 0L)
+ return 36;
if ((active0 & 0x180000008000L) != 0L)
{
jjmatchedKind = 53;
jjmatchedPos = 3;
- return 42;
+ return 36;
}
- if ((active0 & 0x14000L) != 0L)
- return 42;
return -1;
case 4:
if ((active0 & 0x80000008000L) != 0L)
- return 42;
+ return 36;
if ((active0 & 0x100000000000L) != 0L)
{
jjmatchedKind = 53;
jjmatchedPos = 4;
- return 42;
+ return 36;
}
return -1;
case 5:
@@ -352,7 +352,7 @@
{
jjmatchedKind = 53;
jjmatchedPos = 5;
- return 42;
+ return 36;
}
return -1;
case 6:
@@ -360,7 +360,7 @@
{
jjmatchedKind = 53;
jjmatchedPos = 6;
- return 42;
+ return 36;
}
return -1;
case 7:
@@ -368,7 +368,7 @@
{
jjmatchedKind = 53;
jjmatchedPos = 7;
- return 42;
+ return 36;
}
return -1;
case 8:
@@ -376,7 +376,7 @@
{
jjmatchedKind = 53;
jjmatchedPos = 8;
- return 42;
+ return 36;
}
return -1;
default :
@@ -495,11 +495,11 @@
return jjMoveStringLiteralDfa2_1(active0, 0x8000L);
case 101:
if ((active0 & 0x40000000L) != 0L)
- return jjStartNfaWithStates_1(1, 30, 42);
+ return jjStartNfaWithStates_1(1, 30, 36);
else if ((active0 & 0x100000000L) != 0L)
- return jjStartNfaWithStates_1(1, 32, 42);
+ return jjStartNfaWithStates_1(1, 32, 36);
else if ((active0 & 0x1000000000L) != 0L)
- return jjStartNfaWithStates_1(1, 36, 42);
+ return jjStartNfaWithStates_1(1, 36, 36);
break;
case 105:
return jjMoveStringLiteralDfa2_1(active0, 0x4000000000000L);
@@ -511,17 +511,17 @@
return jjMoveStringLiteralDfa2_1(active0, 0x10004000000000L);
case 113:
if ((active0 & 0x400000000L) != 0L)
- return jjStartNfaWithStates_1(1, 34, 42);
+ return jjStartNfaWithStates_1(1, 34, 36);
break;
case 114:
if ((active0 & 0x40000000000L) != 0L)
- return jjStartNfaWithStates_1(1, 42, 42);
+ return jjStartNfaWithStates_1(1, 42, 36);
return jjMoveStringLiteralDfa2_1(active0, 0x4000L);
case 116:
if ((active0 & 0x4000000L) != 0L)
- return jjStartNfaWithStates_1(1, 26, 42);
+ return jjStartNfaWithStates_1(1, 26, 36);
else if ((active0 & 0x10000000L) != 0L)
- return jjStartNfaWithStates_1(1, 28, 42);
+ return jjStartNfaWithStates_1(1, 28, 36);
break;
case 117:
return jjMoveStringLiteralDfa2_1(active0, 0x10000L);
@@ -547,9 +547,9 @@
{
case 100:
if ((active0 & 0x10000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 40, 42);
+ return jjStartNfaWithStates_1(2, 40, 36);
else if ((active0 & 0x10000000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 52, 42);
+ return jjStartNfaWithStates_1(2, 52, 36);
break;
case 108:
return jjMoveStringLiteralDfa3_1(active0, 0x18000L);
@@ -559,13 +559,13 @@
return jjMoveStringLiteralDfa3_1(active0, 0x100000000000L);
case 116:
if ((active0 & 0x4000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 38, 42);
+ return jjStartNfaWithStates_1(2, 38, 36);
break;
case 117:
return jjMoveStringLiteralDfa3_1(active0, 0x4000L);
case 118:
if ((active0 & 0x4000000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 50, 42);
+ return jjStartNfaWithStates_1(2, 50, 36);
break;
default :
break;
@@ -585,11 +585,11 @@
{
case 101:
if ((active0 & 0x4000L) != 0L)
- return jjStartNfaWithStates_1(3, 14, 42);
+ return jjStartNfaWithStates_1(3, 14, 36);
break;
case 108:
if ((active0 & 0x10000L) != 0L)
- return jjStartNfaWithStates_1(3, 16, 42);
+ return jjStartNfaWithStates_1(3, 16, 36);
break;
case 115:
return jjMoveStringLiteralDfa4_1(active0, 0x8000L);
@@ -615,11 +615,11 @@
return jjMoveStringLiteralDfa5_1(active0, 0x100000000000L);
case 101:
if ((active0 & 0x8000L) != 0L)
- return jjStartNfaWithStates_1(4, 15, 42);
+ return jjStartNfaWithStates_1(4, 15, 36);
break;
case 121:
if ((active0 & 0x80000000000L) != 0L)
- return jjStartNfaWithStates_1(4, 43, 42);
+ return jjStartNfaWithStates_1(4, 43, 36);
break;
default :
break;
@@ -711,7 +711,7 @@
{
case 102:
if ((active0 & 0x100000000000L) != 0L)
- return jjStartNfaWithStates_1(9, 44, 42);
+ return jjStartNfaWithStates_1(9, 44, 36);
break;
default :
break;
@@ -740,7 +740,7 @@
{
int[] nextStates;
int startsAt = 0;
- jjnewStateCnt = 42;
+ jjnewStateCnt = 36;
int i = 1;
jjstateSet[0] = startState;
int j, kind = 0x7fffffff;
@@ -766,36 +766,23 @@
{
if (kind > 53)
kind = 53;
- jjCheckNAddStates(9, 15);
+ jjCheckNAddTwoStates(34, 35);
}
else if (curChar == 39)
- jjCheckNAddStates(16, 20);
+ jjCheckNAddStates(9, 13);
else if (curChar == 34)
- jjCheckNAddStates(21, 25);
+ jjCheckNAddStates(14, 18);
else if (curChar == 46)
jjCheckNAdd(1);
break;
- case 42:
- if ((0x3ff601000000000L & l) != 0L)
- jjCheckNAddTwoStates(36, 37);
- else if (curChar == 40)
- {
- if (kind > 56)
- kind = 56;
- }
- else if (curChar == 58)
- jjstateSet[jjnewStateCnt++] = 38;
+ case 36:
if ((0x3ff001000000000L & l) != 0L)
{
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
}
if ((0x3ff001000000000L & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- if ((0x3ff001000000000L & l) != 0L)
- jjCheckNAddStates(26, 28);
- if ((0x3ff001000000000L & l) != 0L)
{
if (kind > 53)
kind = 53;
@@ -880,15 +867,15 @@
break;
case 17:
if (curChar == 34)
- jjCheckNAddStates(21, 25);
+ jjCheckNAddStates(14, 18);
break;
case 18:
if ((0xfffffffbffffffffL & l) != 0L)
- jjCheckNAddStates(29, 31);
+ jjCheckNAddStates(19, 21);
break;
case 20:
if (curChar == 34)
- jjCheckNAddStates(29, 31);
+ jjCheckNAddStates(19, 21);
break;
case 21:
if (curChar == 34 && kind > 12)
@@ -904,15 +891,15 @@
break;
case 25:
if (curChar == 39)
- jjCheckNAddStates(16, 20);
+ jjCheckNAddStates(9, 13);
break;
case 26:
if ((0xffffff7fffffffffL & l) != 0L)
- jjCheckNAddStates(32, 34);
+ jjCheckNAddStates(22, 24);
break;
case 28:
if (curChar == 39)
- jjCheckNAddStates(32, 34);
+ jjCheckNAddStates(22, 24);
break;
case 29:
if (curChar == 39 && kind > 12)
@@ -931,7 +918,7 @@
break;
if (kind > 53)
kind = 53;
- jjCheckNAddStates(9, 15);
+ jjCheckNAddTwoStates(34, 35);
break;
case 34:
if ((0x3ff001000000000L & l) == 0L)
@@ -941,35 +928,11 @@
jjCheckNAdd(34);
break;
case 35:
- if ((0x3ff001000000000L & l) != 0L)
- jjCheckNAddStates(26, 28);
- break;
- case 36:
- if ((0x3ff601000000000L & l) != 0L)
- jjCheckNAddTwoStates(36, 37);
- break;
- case 37:
- if (curChar == 58)
- jjstateSet[jjnewStateCnt++] = 38;
- break;
- case 38:
- if ((0x1800000000L & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- break;
- case 39:
- if ((0x3ff001000000000L & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- break;
- case 40:
- if (curChar == 40 && kind > 56)
- kind = 56;
- break;
- case 41:
if ((0x3ff001000000000L & l) == 0L)
break;
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
break;
default : break;
}
@@ -987,22 +950,16 @@
break;
if (kind > 53)
kind = 53;
- jjCheckNAddStates(9, 15);
+ jjCheckNAddTwoStates(34, 35);
break;
- case 42:
+ case 36:
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
}
if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(36, 37);
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddStates(26, 28);
- if ((0x7fffffe87fffffeL & l) != 0L)
{
if (kind > 53)
kind = 53;
@@ -1011,19 +968,19 @@
break;
case 2:
if ((0x2000000020L & l) != 0L)
- jjAddStates(35, 36);
+ jjAddStates(25, 26);
break;
case 10:
if ((0x2000000020L & l) != 0L)
- jjAddStates(37, 38);
+ jjAddStates(27, 28);
break;
case 14:
if ((0x2000000020L & l) != 0L)
- jjAddStates(39, 40);
+ jjAddStates(29, 30);
break;
case 18:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(29, 31);
+ jjCheckNAddStates(19, 21);
break;
case 19:
if (curChar == 92)
@@ -1031,11 +988,11 @@
break;
case 20:
if (curChar == 92)
- jjCheckNAddStates(29, 31);
+ jjCheckNAddStates(19, 21);
break;
case 22:
if ((0xffffffffefffffffL & l) != 0L)
- jjAddStates(41, 42);
+ jjAddStates(31, 32);
break;
case 23:
if (curChar == 92)
@@ -1048,7 +1005,7 @@
break;
case 26:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(32, 34);
+ jjCheckNAddStates(22, 24);
break;
case 27:
if (curChar == 92)
@@ -1056,11 +1013,11 @@
break;
case 28:
if (curChar == 92)
- jjCheckNAddStates(32, 34);
+ jjCheckNAddStates(22, 24);
break;
case 30:
if ((0xffffffffefffffffL & l) != 0L)
- jjAddStates(43, 44);
+ jjAddStates(33, 34);
break;
case 31:
if (curChar == 92)
@@ -1074,27 +1031,11 @@
jjCheckNAdd(34);
break;
case 35:
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddStates(26, 28);
- break;
- case 36:
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(36, 37);
- break;
- case 38:
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- break;
- case 39:
- if ((0x7fffffe87fffffeL & l) != 0L)
- jjCheckNAddTwoStates(39, 40);
- break;
- case 41:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
break;
default : break;
}
@@ -1116,9 +1057,9 @@
break;
if (kind > 53)
kind = 53;
- jjCheckNAddStates(9, 15);
+ jjCheckNAddTwoStates(34, 35);
break;
- case 42:
+ case 36:
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
{
if (kind > 53)
@@ -1126,25 +1067,19 @@
jjCheckNAdd(34);
}
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(26, 28);
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(36, 37);
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(39, 40);
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
{
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
}
break;
case 18:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(29, 31);
+ jjAddStates(19, 21);
break;
case 22:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(41, 42);
+ jjAddStates(31, 32);
break;
case 24:
case 32:
@@ -1153,11 +1088,11 @@
break;
case 26:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(32, 34);
+ jjAddStates(22, 24);
break;
case 30:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(43, 44);
+ jjAddStates(33, 34);
break;
case 34:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
@@ -1167,27 +1102,11 @@
jjCheckNAdd(34);
break;
case 35:
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddStates(26, 28);
- break;
- case 36:
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(36, 37);
- break;
- case 38:
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(39, 40);
- break;
- case 39:
- if (jjCanMove_1(hiByte, i1, i2, l1, l2))
- jjCheckNAddTwoStates(39, 40);
- break;
- case 41:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
- if (kind > 57)
- kind = 57;
- jjCheckNAdd(41);
+ if (kind > 54)
+ kind = 54;
+ jjCheckNAdd(35);
break;
default : break;
}
@@ -1200,16 +1119,16 @@
kind = 0x7fffffff;
}
++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 42 - (jjnewStateCnt = startsAt)))
+ if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = {
- 0, 1, 3, 5, 6, 7, 8, 13, 14, 34, 35, 36, 37, 39, 40, 41,
- 26, 27, 29, 30, 31, 18, 19, 21, 22, 23, 35, 36, 37, 18, 19, 21,
- 26, 27, 29, 3, 4, 11, 12, 15, 16, 22, 23, 30, 31,
+ 0, 1, 3, 5, 6, 7, 8, 13, 14, 26, 27, 29, 30, 31, 18, 19,
+ 21, 22, 23, 18, 19, 21, 26, 27, 29, 3, 4, 11, 12, 15, 16, 22,
+ 23, 30, 31,
};
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
{
@@ -1250,7 +1169,7 @@
"\154\164", "\76\75", "\147\145", "\74\75", "\154\145", "\75\75", "\145\161", "\41\75",
"\156\145", "\41", "\156\157\164", "\46\46", "\141\156\144", "\174\174", "\157\162",
"\145\155\160\164\171", "\151\156\163\164\141\156\143\145\157\146", "\52", "\53", "\55", "\77", "\57",
-"\144\151\166", "\45", "\155\157\144", null, null, null, null, null, null, null, null, null, };
+"\144\151\166", "\45", "\155\157\144", null, null, null, null, null, null, };
public static final String[] lexStateNames = {
"DEFAULT",
"IN_EXPRESSION",
@@ -1258,17 +1177,17 @@
public static final int[] jjnewLexState = {
-1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
static final long[] jjtoToken = {
- 0x233ffffffffff60fL,
+ 0x47ffffffffff60fL,
};
static final long[] jjtoSkip = {
0x1f0L,
};
protected SimpleCharStream input_stream;
-private final int[] jjrounds = new int[42];
-private final int[] jjstateSet = new int[84];
+private final int[] jjrounds = new int[36];
+private final int[] jjstateSet = new int[72];
protected char curChar;
public ELParserTokenManager(SimpleCharStream stream){
if (SimpleCharStream.staticFlag)
@@ -1290,7 +1209,7 @@
{
int i;
jjround = 0x80000001;
- for (i = 42; i-- > 0;)
+ for (i = 36; i-- > 0;)
jjrounds[i] = 0x80000000;
}
public void ReInit(SimpleCharStream stream, int lexState)
@@ -1363,9 +1282,9 @@
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_1();
- if (jjmatchedPos == 0 && jjmatchedKind > 61)
+ if (jjmatchedPos == 0 && jjmatchedKind > 58)
{
- jjmatchedKind = 61;
+ jjmatchedKind = 58;
}
break;
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-08-04 12:02:57 UTC (rev 735)
+++ trunk/webapps/docs/changelog.xml 2008-08-04 15:11:26 UTC (rev 736)
@@ -30,6 +30,13 @@
</add>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <bug>45511</bug>: New fix for 42565. (markt)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 2.1.1.CR5 (remm)">
15 years, 9 months
JBossWeb SVN: r735 - in trunk: java/org/apache/catalina/connector and 5 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-08-04 08:02:57 -0400 (Mon, 04 Aug 2008)
New Revision: 735
Added:
trunk/java/org/apache/catalina/deploy/SessionCookie.java
trunk/java/org/apache/catalina/startup/Tomcat.java
Modified:
trunk/java/org/apache/catalina/Context.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/startup/ContextRuleSet.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/webapps/docs/changelog.xml
Log:
- Servlet 3.0 style session cookie configuration (except httpOnly).
Modified: trunk/java/org/apache/catalina/Context.java
===================================================================
--- trunk/java/org/apache/catalina/Context.java 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/java/org/apache/catalina/Context.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -21,8 +21,6 @@
import javax.servlet.ServletContext;
-import org.apache.tomcat.util.http.mapper.Mapper;
-
import org.apache.catalina.deploy.ApplicationParameter;
import org.apache.catalina.deploy.ErrorPage;
import org.apache.catalina.deploy.FilterDef;
@@ -30,7 +28,9 @@
import org.apache.catalina.deploy.LoginConfig;
import org.apache.catalina.deploy.NamingResources;
import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.catalina.deploy.SessionCookie;
import org.apache.catalina.util.CharsetMapper;
+import org.apache.tomcat.util.http.mapper.Mapper;
/**
@@ -175,6 +175,20 @@
/**
+ * Set the session cookie configuration.
+ *
+ * @param sessionCookie The new value
+ */
+ public void setSessionCookie(SessionCookie sessionCookie);
+
+
+ /**
+ * Return the session cookie configuration.
+ */
+ public SessionCookie getSessionCookie();
+
+
+ /**
* Set the "use cookies for session ids" flag.
*
* @param cookies The new flag
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/java/org/apache/catalina/connector/Request.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -2396,9 +2396,28 @@
*/
protected void configureSessionCookie(Cookie cookie) {
cookie.setMaxAge(-1);
- cookie.setPath("/");
- if (isSecure()) {
+ if (context.getSessionCookie().getPath() != null) {
+ cookie.setPath(context.getSessionCookie().getPath());
+ } else {
+ String contextPath = context.getEncodedPath();
+ if ("".equals(contextPath)) {
+ contextPath = "/";
+ }
+ cookie.setPath(contextPath);
+ }
+ if (context.getSessionCookie().getComment() != null) {
+ cookie.setComment(context.getSessionCookie().getComment());
+ }
+ if (context.getSessionCookie().getDomain() != null) {
+ cookie.setDomain(context.getSessionCookie().getDomain());
+ }
+ if (context.getSessionCookie().isHttpOnly()) {
+ // FIXME: in Servlet 3.0
+ }
+ if (context.getSessionCookie().isSecure()) {
cookie.setSecure(true);
+ } else if (isSecure()) {
+ cookie.setSecure(true);
}
}
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -89,6 +89,7 @@
import org.apache.catalina.deploy.NamingResources;
import org.apache.catalina.deploy.SecurityCollection;
import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.catalina.deploy.SessionCookie;
import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.session.StandardManager;
import org.apache.catalina.startup.ContextConfig;
@@ -105,7 +106,6 @@
import org.apache.naming.resources.WARDirContext;
import org.apache.tomcat.util.modeler.Registry;
import org.jboss.logging.Logger;
-import org.jboss.logging.Logger;
/**
* Standard implementation of the <b>Context</b> interface. Each
@@ -525,6 +525,11 @@
* The notification sequence number.
*/
private long sequenceNumber = 0;
+
+ /**
+ * The session cookie.
+ */
+ private SessionCookie sessionCookie = new SessionCookie();
/**
* The status code error pages for this web application, keyed by
@@ -1396,6 +1401,26 @@
/**
+ * Set the session cookie configuration.
+ *
+ * @param sessionCookie The new value
+ */
+ public void setSessionCookie(SessionCookie sessionCookie) {
+ SessionCookie oldSessionCookie = this.sessionCookie;
+ this.sessionCookie = sessionCookie;
+ support.firePropertyChange("sessionCookie", oldSessionCookie, sessionCookie);
+ }
+
+
+ /**
+ * Return the session cookie configuration.
+ */
+ public SessionCookie getSessionCookie() {
+ return this.sessionCookie;
+ }
+
+
+ /**
* Return the login configuration descriptor for this web application.
*/
public LoginConfig getLoginConfig() {
Added: trunk/java/org/apache/catalina/deploy/SessionCookie.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/SessionCookie.java (rev 0)
+++ trunk/java/org/apache/catalina/deploy/SessionCookie.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -0,0 +1,72 @@
+/*
+ * 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.catalina.deploy;
+
+import java.io.Serializable;
+
+public class SessionCookie implements Serializable {
+
+ protected String domain = null;
+ protected String path = null;
+ protected String comment = null;
+ protected boolean httpOnly = false;
+ protected boolean secure = false;
+
+ public SessionCookie() {
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public boolean isHttpOnly() {
+ return httpOnly;
+ }
+
+ public boolean isSecure() {
+ return secure;
+ }
+
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ public void setHttpOnly(boolean httpOnly) {
+ this.httpOnly = httpOnly;
+ }
+
+ public void setSecure(boolean secure) {
+ this.secure = secure;
+ }
+}
Modified: trunk/java/org/apache/catalina/startup/ContextRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextRuleSet.java 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/java/org/apache/catalina/startup/ContextRuleSet.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -193,6 +193,12 @@
new SetNextNamingRule("addResourceLink",
"org.apache.catalina.deploy.ContextResourceLink"));
+ digester.addObjectCreate(prefix + "Context/SessionCookie",
+ "org.apache.catalina.deploy.SessionCookie");
+ digester.addSetProperties(prefix + "Context/SessionCookie");
+ digester.addSetNext(prefix + "Context/SessionCookie",
+ "setSessionCookie", "org.apache.catalina.deploy.SessionCookie");
+
digester.addObjectCreate(prefix + "Context/Valve",
null, // MUST be specified in the element
"className");
Added: trunk/java/org/apache/catalina/startup/Tomcat.java
===================================================================
--- trunk/java/org/apache/catalina/startup/Tomcat.java (rev 0)
+++ trunk/java/org/apache/catalina/startup/Tomcat.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -0,0 +1,791 @@
+/*
+ * 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.catalina.startup;
+
+import java.io.File;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Realm;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardServer;
+import org.apache.catalina.core.StandardService;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.catalina.realm.GenericPrincipal;
+import org.apache.catalina.realm.RealmBase;
+import org.apache.catalina.session.StandardManager;
+
+// TODO: lazy init for the temp dir - only when a JSP is compiled or
+// get temp dir is called we need to create it. This will avoid the
+// need for the baseDir
+
+// TODO: allow contexts without a base dir - i.e.
+// only programmatic. This would disable the default servlet.
+
+/**
+ * Minimal tomcat starter for embedding/unit tests.
+ *
+ * Tomcat supports multiple styles of configuration and
+ * startup - the most common and stable is server.xml-based,
+ * implemented in org.apache.catalina.startup.Bootstrap.
+ *
+ * This class is for use in apps that embed tomcat.
+ * Requirements:
+ *
+ * - all tomcat classes and possibly servlets are in the classpath.
+ * ( for example all is in one big jar, or in eclipse CP, or in any other
+ * combination )
+ *
+ * - we need one temporary directory for work files
+ *
+ * - no config file is required. This class provides methods to
+ * use if you have a webapp with a web.xml file, but it is
+ * optional - you can use your own servlets.
+ *
+ * This class provides a main() and few simple CLI arguments,
+ * see setters for doc. It can be used for simple tests and
+ * demo.
+ *
+ * @see TomcatStartupAPITest for examples on how to use this
+ * @author Costin Manolache
+ */
+public class Tomcat {
+ // Single engine, service, server, connector - few cases need more,
+ // they can use server.xml
+ protected StandardServer server;
+ protected StandardService service;
+ protected StandardEngine engine;
+ protected Connector connector; // for more - customize the classes
+
+ // To make it a bit easier to config for the common case
+ // ( one host, one context ).
+ protected StandardHost host;
+
+ // TODO: it's easy to add support for more hosts - but is it
+ // really needed ?
+
+ // TODO: allow use of in-memory connector
+
+ protected int port = 8080;
+ protected String hostname = "localhost";
+ protected String basedir;
+
+ // Default in-memory realm, will be set by default on
+ // created contexts. Can be replaced with setRealm() on
+ // the context.
+ protected Realm defaultRealm;
+ private Map<String, String> userPass = new HashMap<String, String>();
+ private Map<String, List<String>> userRoles =
+ new HashMap<String, List<String>>();
+ private Map<String, Principal> userPrincipals = new HashMap<String, Principal>();
+
+ public Tomcat() {
+ }
+
+ /**
+ * Tomcat needs a directory for temp files. This should be the
+ * first method called.
+ *
+ * By default, if this method is not called, we use:
+ * - system properties - catalina.base, catalina.home
+ * - $HOME/tomcat.$PORT
+ * ( /tmp doesn't seem a good choice for security ).
+ *
+ *
+ * TODO: better default ? Maybe current dir ?
+ * TODO: disable work dir if not needed ( no jsp, etc ).
+ */
+ public void setBaseDir(String basedir) {
+ this.basedir = basedir;
+ }
+
+ /**
+ * Set the port for the default connector. Must
+ * be called before start().
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ /**
+ * The the hostname of the default host, default is
+ * 'localhost'.
+ */
+ public void setHostname(String s) {
+ hostname = s;
+ }
+
+ /**
+ * Add a webapp using normal WEB-INF/web.xml if found.
+ *
+ * @param contextPath
+ * @param baseDir
+ * @return
+ * @throws ServletException
+ */
+ public StandardContext addWebapp(String contextPath,
+ String baseDir) throws ServletException {
+
+ return addWebapp(getHost(), contextPath, baseDir);
+ }
+
+
+ /**
+ * Add a context - programmatic mode, no web.xml used.
+ *
+ * API calls equivalent with web.xml:
+ *
+ * context-param
+ * ctx.addParameter("name", "value");
+ *
+ *
+ * error-page
+ * ErrorPage ep = new ErrorPage();
+ * ep.setErrorCode(500);
+ * ep.setLocation("/error.html");
+ * ctx.addErrorPage(ep);
+ *
+ * ctx.addMimeMapping("ext", "type");
+ *
+ * TODO: add the rest
+ *
+ * @param host NULL for the 'default' host
+ * @param contextPath "/" for root context.
+ * @param dir base dir for the context, for static files. Must exist,
+ * relative to the server home
+ */
+ public StandardContext addContext(String contextPath,
+ String baseDir) {
+ return addContext(getHost(), contextPath, baseDir);
+ }
+
+ public StandardWrapper addServlet(String contextPath,
+ String servletName,
+ String servletClass) {
+ Container ctx = getHost().findChild(contextPath);
+ return addServlet((StandardContext) ctx,
+ servletName, servletClass);
+ }
+
+ /**
+ * Equivalent with
+ * <servlet><servlet-name><servlet-class>.
+ *
+ * In general it is better/faster to use the method that takes a
+ * Servlet as param - this one can be used if the servlet is not
+ * commonly used, and want to avoid loading all deps.
+ * ( for example: jsp servlet )
+ *
+ * You can customize the returned servlet, ex:
+ *
+ * wrapper.addInitParameter("name", "value");
+ */
+ public StandardWrapper addServlet(StandardContext ctx,
+ String servletName,
+ String servletClass) {
+ // will do class for name and set init params
+ StandardWrapper sw = (StandardWrapper)ctx.createWrapper();
+ sw.setServletClass(servletClass);
+ sw.setName(servletName);
+ ctx.addChild(sw);
+
+ return sw;
+ }
+
+ /** Use an existing servlet, no class.forName or initialization will be
+ * performed
+ */
+ public StandardWrapper addServlet(StandardContext ctx,
+ String servletName,
+ Servlet servlet) {
+ // will do class for name and set init params
+ StandardWrapper sw = new ExistingStandardWrapper(servlet);
+ sw.setName(servletName);
+ ctx.addChild(sw);
+
+ return sw;
+ }
+
+
+ /**
+ * Initialize and start the server.
+ */
+ public void start() throws Exception {
+ setSilent();
+ getServer();
+ getConnector();
+ server.initialize();
+ server.start();
+ }
+
+ /**
+ * Stop the server.
+ */
+ public void stop() throws Exception {
+ getServer().stop();
+ }
+
+
+ /**
+ * Add a user for the in-memory realm. All created apps use this
+ * by default, can be replaced using setRealm().
+ *
+ */
+ public void addUser(String user, String pass) {
+ userPass.put(user, pass);
+ }
+
+ /**
+ * @see addUser
+ */
+ public void addRole(String user, String role) {
+ List<String> roles = userRoles.get(user);
+ if (roles == null) {
+ roles = new ArrayList<String>();
+ userRoles.put(user, roles);
+ }
+ roles.add(role);
+ }
+
+ // ------- Extra customization -------
+ // You can tune individual tomcat objects, using internal APIs
+
+ /**
+ * Get the default http connector. You can set more
+ * parameters - the port is already initialized.
+ *
+ * Alternatively, you can construct a Connector and set any params,
+ * then call addConnector(Connector)
+ *
+ * @return A connector object that can be customized
+ */
+ public Connector getConnector() throws Exception {
+ getServer();
+ if (connector != null) {
+ return connector;
+ }
+ // This will load Apr connector if available,
+ // default to nio. I'm having strange problems with apr
+ // and for the use case the speed benefit wouldn't matter.
+
+ //connector = new Connector("HTTP/1.1");
+ connector = new Connector("org.apache.coyote.http11.Http11Protocol");
+ connector.setPort(port);
+ service.addConnector( connector );
+ return connector;
+ }
+
+ public void setConnector(Connector connector) {
+ this.connector = connector;
+ }
+
+ /**
+ * Get the service object. Can be used to add more
+ * connectors and few other global settings.
+ */
+ public StandardService getService() {
+ getServer();
+ return service;
+ }
+
+ /**
+ * Sets the current host - all future webapps will
+ * be added to this host. When tomcat starts, the
+ * host will be the default host.
+ *
+ * @param host
+ */
+ public void setHost(StandardHost host) {
+ this.host = host;
+ }
+
+ public StandardHost getHost() {
+ if (host == null) {
+ host = new StandardHost();
+ host.setName(hostname);
+
+ getEngine().addChild( host );
+ }
+ return host;
+ }
+
+ /**
+ * Set a custom realm for auth. If not called, a simple
+ * default will be used, using an internal map.
+ *
+ * Must be called before adding a context.
+ */
+ public void setDefaultRealm(Realm realm) {
+ defaultRealm = realm;
+ }
+
+
+ /**
+ * Access to the engine, for further customization.
+ */
+ public StandardEngine getEngine() {
+ if(engine == null ) {
+ getServer();
+ engine = new StandardEngine();
+ engine.setName( "default" );
+ engine.setDefaultHost(hostname);
+ service.setContainer(engine);
+ }
+ return engine;
+ }
+
+ /**
+ * Get the server object. You can add listeners and
+ * few more customizations.
+ */
+ public StandardServer getServer() {
+
+ if (server != null) {
+ return server;
+ }
+
+ initBaseDir();
+
+ System.setProperty("catalina.useNaming", "false");
+
+ server = new StandardServer();
+ server.setPort( -1 );
+
+ service = new StandardService();
+ service.setName("Tomcat");
+ server.addService( service );
+ return server;
+ }
+
+ public StandardContext addContext(StandardHost host,
+ String contextPath,
+ String dir) {
+ silence(contextPath);
+ StandardContext ctx = new StandardContext();
+ ctx.setPath( contextPath );
+ ctx.setDocBase(dir);
+ ctx.addLifecycleListener(new FixContextListener());
+
+ if (host == null) {
+ host = getHost();
+ }
+ host.addChild(ctx);
+ return ctx;
+ }
+
+ public StandardContext addWebapp(StandardHost host,
+ String url, String path)
+ throws ServletException {
+ silence(url);
+
+ StandardContext ctx = new StandardContext();
+ ctx.setPath( url );
+ ctx.setDocBase(path);
+ if (defaultRealm == null) {
+ initSimpleAuth();
+ }
+ ctx.setRealm(defaultRealm);
+ initWebappDefaults(ctx);
+
+ ContextConfig ctxCfg = new ContextConfig();
+ ctx.addLifecycleListener( ctxCfg );
+ // prevent it from looking ( if it finds one - it'll have dup error )
+ ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
+
+ if (host == null) {
+ host = getHost();
+ }
+ host.addChild(ctx);
+
+ return ctx;
+ }
+
+
+
+
+
+ // ---------- Helper methods and classes -------------------
+
+ /**
+ * Initialize an in-memory realm. You can replace it
+ * for contexts with a real one.
+ */
+ protected void initSimpleAuth() {
+ defaultRealm = new RealmBase() {
+ @Override
+ protected String getName() {
+ return "Simple";
+ }
+
+ @Override
+ protected String getPassword(String username) {
+ return userPass.get(username);
+ }
+
+ @Override
+ protected Principal getPrincipal(String username) {
+ Principal p = userPrincipals.get(username);
+ if (p == null) {
+ String pass = userPass.get(username);
+ if (pass != null) {
+ p = new GenericPrincipal(this, username, pass,
+ userRoles.get(username));
+ userPrincipals.put(username, p);
+ }
+ }
+ return p;
+ }
+
+ };
+ }
+
+ protected void initBaseDir() {
+ if (basedir == null) {
+ basedir = System.getProperty("catalina.base");
+ }
+ if (basedir == null) {
+ basedir = System.getProperty("catalina.home");
+ }
+ if (basedir == null) {
+ // Create a temp dir.
+ basedir = System.getProperty("user.dir") +
+ "/tomcat." + port;
+ File home = new File(basedir);
+ home.mkdir();
+ if (!home.isAbsolute()) {
+ try {
+ basedir = home.getCanonicalPath();
+ } catch (IOException e) {
+ basedir = home.getAbsolutePath();
+ }
+ }
+ }
+ System.setProperty("catalina.home", basedir);
+ System.setProperty("catalina.base", basedir);
+ }
+
+ static String[] silences = new String[] {
+ "org.apache.coyote.http11.Http11Protocol",
+ "org.apache.catalina.core.StandardService",
+ "org.apache.catalina.core.StandardEngine",
+ "org.apache.catalina.startup.ContextConfig",
+ "org.apache.catalina.core.ApplicationContext",
+ };
+
+ public void setSilent() {
+ for (String s : silences) {
+ Logger.getLogger(s).setLevel(Level.WARNING);
+ }
+ }
+
+ private void silence(String ctx) {
+ String base = "org.apache.catalina.core.ContainerBase.[default].[";
+ base += getHost().getName();
+ base += "].[";
+ base += ctx;
+ base += "]";
+ Logger.getLogger(base).setLevel(Level.WARNING);
+ }
+
+ /** Init default servlets for the context. This should be the programmatic
+ * equivalent of the default web.xml.
+ *
+ * TODO: in normal tomcat, if default-web.xml is not found, use this
+ * method
+ */
+ protected void initWebappDefaults(StandardContext ctx) {
+ // Default servlet
+ StandardWrapper servlet =
+ addServlet(ctx, "default",
+ //new DefaultServlet());
+ // Or:
+ "org.apache.catalina.servlets.DefaultServlet");
+ servlet.addInitParameter("listings", "false");
+ servlet.setLoadOnStartup(1);
+
+ // class name - to avoid loading all deps
+ servlet = addServlet(ctx, "jsp",
+ "org.apache.jasper.servlet.JspServlet");
+ servlet.addInitParameter("fork", "false");
+ servlet.addInitParameter("xpoweredBy", "false");
+
+ // in default web.xml - but not here, only needed if you have
+ // jsps.
+ //servlet.setLoadOnStartup(3);
+
+ ctx.addServletMapping("/", "default");
+ ctx.addServletMapping("*.jsp", "jsp");
+ ctx.addServletMapping("*.jspx", "jsp");
+ // Sessions
+ ctx.setManager( new StandardManager());
+ ctx.setSessionTimeout(30);
+
+ // TODO: read mime from /etc/mime.types on linux, or some
+ // resource
+ for (int i = 0; i < DEFAULT_MIME_MAPPINGS.length; ) {
+ ctx.addMimeMapping(DEFAULT_MIME_MAPPINGS[i++],
+ DEFAULT_MIME_MAPPINGS[i++]);
+ }
+ ctx.addWelcomeFile("index.html");
+ ctx.addWelcomeFile("index.htm");
+ ctx.addWelcomeFile("index.jsp");
+
+ ctx.setLoginConfig( new LoginConfig("NONE", null, null, null));
+
+ // TODO: set a default realm, add simple API to add users
+ }
+
+
+ /** Fix startup sequence - required if you don't use web.xml.
+ *
+ * The start() method in context will set 'configured' to false - and
+ * expects a listener to set it back to true.
+ */
+ public static class FixContextListener implements LifecycleListener {
+
+ public void lifecycleEvent(LifecycleEvent event) {
+ try {
+ Context context = (Context) event.getLifecycle();
+ if (event.getType().equals(Lifecycle.START_EVENT)) {
+ context.setConfigured(true);
+ }
+ } catch (ClassCastException e) {
+ return;
+ }
+ }
+
+ }
+
+ /** Helper class for wrapping existing servlets. This disables servlet
+ * lifecycle and normal reloading, but also reduces overhead and provide
+ * more direct control over the servlet.
+ */
+ public static class ExistingStandardWrapper extends StandardWrapper {
+ private Servlet existing;
+ boolean init = false;
+
+ public ExistingStandardWrapper( Servlet existing ) {
+ this.existing = existing;
+ }
+ public synchronized Servlet loadServlet() throws ServletException {
+ if (!init) {
+ existing.init(facade);
+ init = true;
+ }
+ return existing;
+
+ }
+ public long getAvailable() {
+ return 0;
+ }
+ public boolean isUnavailable() {
+ return false;
+ }
+ }
+
+ /**
+ * TODO: would a properties resource be better ? Or just parsing
+ * /etc/mime.types ?
+ * This is needed because we don't use the default web.xml, where this
+ * is encoded.
+ */
+ public static final String[] DEFAULT_MIME_MAPPINGS = {
+ "abs", "audio/x-mpeg",
+ "ai", "application/postscript",
+ "aif", "audio/x-aiff",
+ "aifc", "audio/x-aiff",
+ "aiff", "audio/x-aiff",
+ "aim", "application/x-aim",
+ "art", "image/x-jg",
+ "asf", "video/x-ms-asf",
+ "asx", "video/x-ms-asf",
+ "au", "audio/basic",
+ "avi", "video/x-msvideo",
+ "avx", "video/x-rad-screenplay",
+ "bcpio", "application/x-bcpio",
+ "bin", "application/octet-stream",
+ "bmp", "image/bmp",
+ "body", "text/html",
+ "cdf", "application/x-cdf",
+ "cer", "application/x-x509-ca-cert",
+ "class", "application/java",
+ "cpio", "application/x-cpio",
+ "csh", "application/x-csh",
+ "css", "text/css",
+ "dib", "image/bmp",
+ "doc", "application/msword",
+ "dtd", "application/xml-dtd",
+ "dv", "video/x-dv",
+ "dvi", "application/x-dvi",
+ "eps", "application/postscript",
+ "etx", "text/x-setext",
+ "exe", "application/octet-stream",
+ "gif", "image/gif",
+ "gtar", "application/x-gtar",
+ "gz", "application/x-gzip",
+ "hdf", "application/x-hdf",
+ "hqx", "application/mac-binhex40",
+ "htc", "text/x-component",
+ "htm", "text/html",
+ "html", "text/html",
+ "hqx", "application/mac-binhex40",
+ "ief", "image/ief",
+ "jad", "text/vnd.sun.j2me.app-descriptor",
+ "jar", "application/java-archive",
+ "java", "text/plain",
+ "jnlp", "application/x-java-jnlp-file",
+ "jpe", "image/jpeg",
+ "jpeg", "image/jpeg",
+ "jpg", "image/jpeg",
+ "js", "text/javascript",
+ "jsf", "text/plain",
+ "jspf", "text/plain",
+ "kar", "audio/x-midi",
+ "latex", "application/x-latex",
+ "m3u", "audio/x-mpegurl",
+ "mac", "image/x-macpaint",
+ "man", "application/x-troff-man",
+ "mathml", "application/mathml+xml",
+ "me", "application/x-troff-me",
+ "mid", "audio/x-midi",
+ "midi", "audio/x-midi",
+ "mif", "application/x-mif",
+ "mov", "video/quicktime",
+ "movie", "video/x-sgi-movie",
+ "mp1", "audio/x-mpeg",
+ "mp2", "audio/x-mpeg",
+ "mp3", "audio/x-mpeg",
+ "mp4", "video/mp4",
+ "mpa", "audio/x-mpeg",
+ "mpe", "video/mpeg",
+ "mpeg", "video/mpeg",
+ "mpega", "audio/x-mpeg",
+ "mpg", "video/mpeg",
+ "mpv2", "video/mpeg2",
+ "ms", "application/x-wais-source",
+ "nc", "application/x-netcdf",
+ "oda", "application/oda",
+ "odb", "application/vnd.oasis.opendocument.database",
+ "odc", "application/vnd.oasis.opendocument.chart",
+ "odf", "application/vnd.oasis.opendocument.formula",
+ "odg", "application/vnd.oasis.opendocument.graphics",
+ "odi", "application/vnd.oasis.opendocument.image",
+ "odm", "application/vnd.oasis.opendocument.text-master",
+ "odp", "application/vnd.oasis.opendocument.presentation",
+ "ods", "application/vnd.oasis.opendocument.spreadsheet",
+ "odt", "application/vnd.oasis.opendocument.text",
+ "ogg", "application/ogg",
+ "otg ", "application/vnd.oasis.opendocument.graphics-template",
+ "oth", "application/vnd.oasis.opendocument.text-web",
+ "otp", "application/vnd.oasis.opendocument.presentation-template",
+ "ots", "application/vnd.oasis.opendocument.spreadsheet-template ",
+ "ott", "application/vnd.oasis.opendocument.text-template",
+ "pbm", "image/x-portable-bitmap",
+ "pct", "image/pict",
+ "pdf", "application/pdf",
+ "pgm", "image/x-portable-graymap",
+ "pic", "image/pict",
+ "pict", "image/pict",
+ "pls", "audio/x-scpls",
+ "png", "image/png",
+ "pnm", "image/x-portable-anymap",
+ "pnt", "image/x-macpaint",
+ "ppm", "image/x-portable-pixmap",
+ "ppt", "application/powerpoint",
+ "ps", "application/postscript",
+ "psd", "image/x-photoshop",
+ "qt", "video/quicktime",
+ "qti", "image/x-quicktime",
+ "qtif", "image/x-quicktime",
+ "ras", "image/x-cmu-raster",
+ "rdf", "application/rdf+xml",
+ "rgb", "image/x-rgb",
+ "rm", "application/vnd.rn-realmedia",
+ "roff", "application/x-troff",
+ "rtf", "application/rtf",
+ "rtx", "text/richtext",
+ "sh", "application/x-sh",
+ "shar", "application/x-shar",
+ /*"shtml", "text/x-server-parsed-html",*/
+ "smf", "audio/x-midi",
+ "sit", "application/x-stuffit",
+ "snd", "audio/basic",
+ "src", "application/x-wais-source",
+ "sv4cpio", "application/x-sv4cpio",
+ "sv4crc", "application/x-sv4crc",
+ "swf", "application/x-shockwave-flash",
+ "t", "application/x-troff",
+ "tar", "application/x-tar",
+ "tcl", "application/x-tcl",
+ "tex", "application/x-tex",
+ "texi", "application/x-texinfo",
+ "texinfo", "application/x-texinfo",
+ "tif", "image/tiff",
+ "tiff", "image/tiff",
+ "tr", "application/x-troff",
+ "tsv", "text/tab-separated-values",
+ "txt", "text/plain",
+ "ulw", "audio/basic",
+ "ustar", "application/x-ustar",
+ "vxml", "application/voicexml+xml",
+ "xbm", "image/x-xbitmap",
+ "xht", "application/xhtml+xml",
+ "xhtml", "application/xhtml+xml",
+ "xml", "application/xml",
+ "xpm", "image/x-xpixmap",
+ "xsl", "application/xml",
+ "xslt", "application/xslt+xml",
+ "xul", "application/vnd.mozilla.xul+xml",
+ "xwd", "image/x-xwindowdump",
+ "wav", "audio/x-wav",
+ "svg", "image/svg+xml",
+ "svgz", "image/svg+xml",
+ "vsd", "application/x-visio",
+ "wbmp", "image/vnd.wap.wbmp",
+ "wml", "text/vnd.wap.wml",
+ "wmlc", "application/vnd.wap.wmlc",
+ "wmls", "text/vnd.wap.wmlscript",
+ "wmlscriptc", "application/vnd.wap.wmlscriptc",
+ "wmv", "video/x-ms-wmv",
+ "wrl", "x-world/x-vrml",
+ "wspolicy", "application/wspolicy+xml",
+ "Z", "application/x-compress",
+ "z", "application/x-compress",
+ "zip", "application/zip",
+ "xls", "application/vnd.ms-excel",
+ "doc", "application/vnd.ms-word",
+ "ppt", "application/vnd.ms-powerpoint"
+ };
+}
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-08-04 12:02:57 UTC (rev 735)
@@ -596,7 +596,7 @@
if (!reverseConnection) {
// Create the APR server socket
- serverSock = Socket.create(family, Socket.SOCK_STREAM,
+ serverSock = Socket.create(Address.getInfo(inetAddress).family, Socket.SOCK_STREAM,
Socket.APR_PROTO_TCP, rootPool);
if (OS.IS_UNIX) {
Socket.optSet(serverSock, Socket.APR_SO_REUSEADDR, 1);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-08-04 11:37:52 UTC (rev 734)
+++ trunk/webapps/docs/changelog.xml 2008-08-04 12:02:57 UTC (rev 735)
@@ -22,6 +22,12 @@
<fix>
<bug>45453</bug>: Sync getPrincipal in JDBCRealm. (markt)
</fix>
+ <add>
+ <jira>107</jira>: Servlet 3.0 style session cookie configuration. (remm)
+ </add>
+ <add>
+ New embedded API (startup.Tomcat class). (remm)
+ </add>
</changelog>
</subsection>
</section>
15 years, 9 months
JBossWeb SVN: r734 - in branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache: coyote and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-08-04 07:37:52 -0400 (Mon, 04 Aug 2008)
New Revision: 734
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardContextValve.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/Constants.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalAprOutputBuffer.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalNioOutputBuffer.java
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalOutputBuffer.java
Log:
- CVE-2008-1232: XSS in error messages.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardContextValve.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/StandardContextValve.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -120,8 +120,7 @@
|| (requestPathMB.equalsIgnoreCase("/META-INF"))
|| (requestPathMB.startsWithIgnoreCase("/WEB-INF/", 0))
|| (requestPathMB.equalsIgnoreCase("/WEB-INF"))) {
- String requestURI = request.getDecodedRequestURI();
- notFound(requestURI, response);
+ notFound(response);
return;
}
@@ -137,8 +136,7 @@
// Select the Wrapper to be used for this Request
Wrapper wrapper = request.getWrapper();
if (wrapper == null) {
- String requestURI = request.getDecodedRequestURI();
- notFound(requestURI, response);
+ notFound(response);
return;
}
@@ -289,10 +287,10 @@
* @param requestURI The request URI for the requested resource
* @param response The response we are creating
*/
- private void notFound(String requestURI, HttpServletResponse response) {
+ private void notFound(HttpServletResponse response) {
try {
- response.sendError(HttpServletResponse.SC_NOT_FOUND, requestURI);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
} catch (IllegalStateException e) {
;
} catch (IOException e) {
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/Constants.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/Constants.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/Constants.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -60,5 +60,13 @@
(System.getSecurityManager() != null);
+ /**
+ * If true, custom HTTP status messages will be used in headers.
+ */
+ public static final boolean USE_CUSTOM_STATUS_MSG_IN_HEADER =
+ Boolean.valueOf(System.getProperty(
+ "org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER",
+ "false")).booleanValue();
+
}
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -915,7 +915,10 @@
// HTTP header contents
responseHeaderMessage.appendInt(response.getStatus());
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null){
message = HttpMessages.getMessage(response.getStatus());
} else {
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -921,7 +921,10 @@
// HTTP header contents
responseHeaderMessage.appendInt(response.getStatus());
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null){
message = HttpMessages.getMessage(response.getStatus());
} else {
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalAprOutputBuffer.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalAprOutputBuffer.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -421,11 +421,14 @@
buf[pos++] = Constants.SP;
// Write message
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null) {
write(HttpMessages.getMessage(status));
} else {
- write(message);
+ write(message.replace('\n', ' ').replace('\r', ' '));
}
// End the response status line
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalNioOutputBuffer.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalNioOutputBuffer.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalNioOutputBuffer.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -471,11 +471,14 @@
buf[pos++] = Constants.SP;
// Write message
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null) {
write(HttpMessages.getMessage(status));
} else {
- write(message);
+ write(message.replace('\n', ' ').replace('\r', ' '));
}
// End the response status line
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalOutputBuffer.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalOutputBuffer.java 2008-08-04 11:15:14 UTC (rev 733)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/coyote/http11/InternalOutputBuffer.java 2008-08-04 11:37:52 UTC (rev 734)
@@ -438,11 +438,14 @@
buf[pos++] = Constants.SP;
// Write message
- String message = response.getMessage();
+ String message = null;
+ if (org.apache.coyote.Constants.USE_CUSTOM_STATUS_MSG_IN_HEADER) {
+ message = response.getMessage();
+ }
if (message == null) {
- write(getMessage(status));
+ write(HttpMessages.getMessage(status));
} else {
- write(message);
+ write(message.replace('\n', ' ').replace('\r', ' '));
}
// End the response status line
15 years, 9 months
JBossWeb SVN: r733 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2008-08-04 07:15:14 -0400 (Mon, 04 Aug 2008)
New Revision: 733
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/ApplicationContext.java
Log:
- CVE-2008-2370: request dispatcher query string.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/ApplicationContext.java 2008-07-29 15:41:07 UTC (rev 732)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/catalina/core/ApplicationContext.java 2008-08-04 11:15:14 UTC (rev 733)
@@ -368,10 +368,21 @@
throw new IllegalArgumentException
(sm.getString
("applicationContext.requestDispatcher.iae", path));
+
+ // Get query string
+ String queryString = null;
+ int pos = path.indexOf('?');
+ if (pos >= 0) {
+ queryString = path.substring(pos + 1);
+ path = path.substring(0, pos);
+ }
+
path = normalize(path);
if (path == null)
return (null);
+ pos = path.length();
+
// Use the thread local URI and mapping data
DispatchData dd = dispatchData.get();
if (dd == null) {
@@ -382,15 +393,6 @@
MessageBytes uriMB = dd.uriMB;
uriMB.recycle();
- // Get query string
- String queryString = null;
- int pos = path.indexOf('?');
- if (pos >= 0) {
- queryString = path.substring(pos + 1);
- } else {
- pos = path.length();
- }
-
// Use the thread local mapping data
MappingData mappingData = dd.mappingData;
15 years, 9 months