[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Initial set of patches for Jakarta EE 9

2019-11-28 Thread Mark Thomas
Hi all,

I have pushed an initial set of patches for Jakarta EE 9 here:
https://github.com/markt-asf/tomcat/tree/jakarta

The current status is:
- All the packages changing in Jakarta EE 9 have been renamed
- Any associated constants, service loader files etc. have also been
  renamed
- It builds
- The unit tests pass (excluding those that depend on JSTL - more on
  that below)
- A basic smoke test passes

Please try and build it, take it for a spin and report back on this
thread if you find any issues.

Right, JSTL. I don't particularly want us to have to produce a Jakarta
EE version of JSTL. So, I plan to use this as the first test case for my
"Java EE to Jakarta EE converter". I've only just started work on this
so I don't have any real progress to report. I hope to make progress on
this next week.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

--- Comment #9 from Dmitry Treskunov  ---
Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

--- Comment #8 from Mark Thomas  ---
I'm expecting to start the release early next week so it should be available
towards the end of next week / beginning of the following week.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

--- Comment #7 from Dmitry Treskunov  ---
Hi, thanks, it works! 
Do you have any estimates for the 8.5.50 release?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
 new aad9939  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag 
& gzip
aad9939 is described below

commit aad993909f254539e38b9aca6e9be505437c4a43
Author: Mark Thomas 
AuthorDate: Thu Nov 28 16:33:16 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

By default, do not compress content that has a strong ETag. This
behaviour is configuration for the HTTP/1.1 and HTTP/2 connectors via
the new Connector attribute noCompressionStrongETag
---
 .../coyote/http11/AbstractHttp11Processor.java | 27 --
 .../coyote/http11/AbstractHttp11Protocol.java  | 10 
 .../apache/coyote/http11/Http11AprProtocol.java|  4 ++--
 .../apache/coyote/http11/Http11NioProtocol.java|  4 ++--
 java/org/apache/coyote/http11/Http11Protocol.java  |  4 ++--
 webapps/docs/changelog.xml | 10 
 webapps/docs/config/http.xml   |  8 +++
 7 files changed, 59 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/coyote/http11/AbstractHttp11Processor.java 
b/java/org/apache/coyote/http11/AbstractHttp11Processor.java
index 288b4ed..787d388 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Processor.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Processor.java
@@ -216,6 +216,12 @@ public abstract class AbstractHttp11Processor extends 
AbstractProcessor {
 
 
 /**
+ * Flag to disable compression when the resource has a strong ETag.
+ */
+protected boolean noCompressionStrongETag = true;
+
+
+/**
  * Minimum content size to make compression.
  */
 protected int compressionMinSize = 2048;
@@ -334,6 +340,11 @@ public abstract class AbstractHttp11Processor extends 
AbstractProcessor {
 }
 
 
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
+this.noCompressionStrongETag = noCompressionStrongETag;
+}
+
+
 /**
  * Set no compression user agent pattern. Regular expression as supported
  * by {@link Pattern}.
@@ -607,15 +618,17 @@ public abstract class AbstractHttp11Processor extends 
AbstractProcessor {
  */
 private boolean isCompressible() {
 
+MimeHeaders responseHeaders = response.getMimeHeaders();
+
 // Check if content is not already compressed
-MessageBytes contentEncodingMB = 
response.getMimeHeaders().getValue("Content-Encoding");
+MessageBytes contentEncodingMB = 
responseHeaders.getValue("Content-Encoding");
 
 if (contentEncodingMB != null) {
 // Content-Encoding values are ordered but order is not important
 // for this check so use a Set rather than a List
 Set tokens = new HashSet();
 try {
-
TokenList.parseTokenList(response.getMimeHeaders().values("Content-Encoding"), 
tokens);
+
TokenList.parseTokenList(responseHeaders.values("Content-Encoding"), tokens);
 } catch (IOException e) {
 // Because we are using StringReader, any exception here is a
 // Tomcat bug.
@@ -627,6 +640,16 @@ public abstract class AbstractHttp11Processor extends 
AbstractProcessor {
 }
 }
 
+// Check if the resource has a strong ETag
+if (noCompressionStrongETag) {
+String eTag = responseHeaders.getHeader("ETag");
+if (eTag != null && !eTag.trim().startsWith("W/")) {
+// Has an ETag that doesn't start with "W/..." so it must be a
+// strong ETag
+return false;
+}
+}
+
 // If force mode, always compress (test purposes only)
 if (compressionLevel == 2) {
 return true;
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 334116d..1993fcc 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -203,6 +203,15 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 }
 
 
+private boolean noCompressionStrongETag = true;
+public boolean getNoCompressionStrongETag() {
+return noCompressionStrongETag;
+}
+public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+this.noCompressionStrongETag = noCompressionStrongETag;
+}
+
+
 /**
  * Regular expression that defines the User agents which should be
  * restricted to HTTP/1.0 support.
@@ -362,6 +371,7 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 processor.setConnectionUploadTimeout(getConnectionUploadTimeout());
 

[Bug 63932] Content compression breaks contract of ETag

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63932

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #18 from Mark Thomas  ---
Fixed in:
- master for 9.0.30 onwards
- 8.5.x for 8.5.50 onwards
- 7.0.x for 7.0.99 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Fix case inconsistency

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new ca2be3c  Fix case inconsistency
ca2be3c is described below

commit ca2be3ccb001ad2e965a54335b64f4b76396dcbc
Author: Mark Thomas 
AuthorDate: Thu Nov 28 16:31:24 2019 +

Fix case inconsistency
---
 java/org/apache/coyote/CompressionConfig.java | 2 +-
 java/org/apache/coyote/http11/AbstractHttp11Protocol.java | 4 ++--
 java/org/apache/coyote/http2/Http2Protocol.java   | 4 ++--
 test/org/apache/coyote/TestCompressionConfig.java | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/CompressionConfig.java 
b/java/org/apache/coyote/CompressionConfig.java
index 8bb11f9..5d26c88 100644
--- a/java/org/apache/coyote/CompressionConfig.java
+++ b/java/org/apache/coyote/CompressionConfig.java
@@ -207,7 +207,7 @@ public class CompressionConfig {
  * {@code true}
  */
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
 this.noCompressionStrongETag = noCompressionStrongETag;
 }
 
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 4d65942..0833e2e 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -270,8 +270,8 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 return compressionConfig.getNoCompressionStrongETag();
 }
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
-compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
 }
 
 
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 0afb255..300e17a 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -401,8 +401,8 @@ public class Http2Protocol implements UpgradeProtocol {
 return compressionConfig.getNoCompressionStrongETag();
 }
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
-compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
 }
 
 
diff --git a/test/org/apache/coyote/TestCompressionConfig.java 
b/test/org/apache/coyote/TestCompressionConfig.java
index 0d8c0a0..71b1c00 100644
--- a/test/org/apache/coyote/TestCompressionConfig.java
+++ b/test/org/apache/coyote/TestCompressionConfig.java
@@ -67,7 +67,7 @@ public class TestCompressionConfig {
 CompressionConfig compressionConfig = new CompressionConfig();
 // Skip length and MIME type checks
 compressionConfig.setCompression("force");
-
compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag.booleanValue());
+
compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag.booleanValue());
 
 Request request = new Request();
 Response response = new Response();


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Fix case inconsistency

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new db832a5  Fix case inconsistency
db832a5 is described below

commit db832a5e1f2ab235080101d5cf0bf5c3849b6246
Author: Mark Thomas 
AuthorDate: Thu Nov 28 16:31:24 2019 +

Fix case inconsistency
---
 java/org/apache/coyote/CompressionConfig.java | 2 +-
 java/org/apache/coyote/http11/AbstractHttp11Protocol.java | 4 ++--
 java/org/apache/coyote/http2/Http2Protocol.java   | 4 ++--
 test/org/apache/coyote/TestCompressionConfig.java | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/coyote/CompressionConfig.java 
b/java/org/apache/coyote/CompressionConfig.java
index 8bb11f9..5d26c88 100644
--- a/java/org/apache/coyote/CompressionConfig.java
+++ b/java/org/apache/coyote/CompressionConfig.java
@@ -207,7 +207,7 @@ public class CompressionConfig {
  * {@code true}
  */
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
 this.noCompressionStrongETag = noCompressionStrongETag;
 }
 
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 70387b9..ab2a482 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -284,8 +284,8 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 return compressionConfig.getNoCompressionStrongETag();
 }
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
-compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
 }
 
 
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 1f3dfe0..f11f2d1 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -410,8 +410,8 @@ public class Http2Protocol implements UpgradeProtocol {
 return compressionConfig.getNoCompressionStrongETag();
 }
 @Deprecated
-public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
-compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+public void setNoCompressionStrongETag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag);
 }
 
 
diff --git a/test/org/apache/coyote/TestCompressionConfig.java 
b/test/org/apache/coyote/TestCompressionConfig.java
index 0d8c0a0..71b1c00 100644
--- a/test/org/apache/coyote/TestCompressionConfig.java
+++ b/test/org/apache/coyote/TestCompressionConfig.java
@@ -67,7 +67,7 @@ public class TestCompressionConfig {
 CompressionConfig compressionConfig = new CompressionConfig();
 // Skip length and MIME type checks
 compressionConfig.setCompression("force");
-
compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag.booleanValue());
+
compressionConfig.setNoCompressionStrongETag(noCompressionStrongETag.booleanValue());
 
 Request request = new Request();
 Response response = new Response();


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63969] Stackoverflow in JSF

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63969

Mark Thomas  changed:

   What|Removed |Added

 CC||wlpa2...@gmail.com

--- Comment #2 from Mark Thomas  ---
*** Bug 63976 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63976] icefaces 1.8 component showcase

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63976

Mark Thomas  changed:

   What|Removed |Added

 OS||All
 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #2 from Mark Thomas  ---


*** This bug has been marked as a duplicate of bug 63969 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63976] icefaces 1.8 component showcase

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63976

--- Comment #1 from Patrick WENDJI  ---
Created attachment 36905
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36905&action=edit
link to the showcase war

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63976] New: icefaces 1.8 component showcase

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63976

Bug ID: 63976
   Summary: icefaces 1.8 component showcase
   Product: Tomcat 8
   Version: 8.5.49
  Hardware: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: EL
  Assignee: dev@tomcat.apache.org
  Reporter: wlpa2...@gmail.com
  Target Milestone: 

I have a StackOverflow error after deploying the icefaces component showcase
1.8 on tomcat 8.5.49 when i access the application.
It didn't happen on version 8.5.47.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 8ff903b  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag 
& gzip
8ff903b is described below

commit 8ff903b9a9b64fa30677f44e130d9b0898704a0b
Author: Mark Thomas 
AuthorDate: Thu Nov 28 14:44:20 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

By default, do not compress content that has a strong ETag. This
behaviour is configuration for the HTTP/1.1 and HTTP/2 connectors via
the new Connector attribute noCompressionStrongETag
---
 java/org/apache/coyote/CompressionConfig.java  | 40 ++
 .../coyote/http11/AbstractHttp11Protocol.java  | 10 ++
 java/org/apache/coyote/http2/Http2Protocol.java| 10 ++
 test/org/apache/coyote/TestCompressionConfig.java  | 33 ++
 webapps/docs/changelog.xml |  6 
 webapps/docs/config/http.xml   |  8 +
 webapps/docs/config/http2.xml  |  8 +
 7 files changed, 108 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/CompressionConfig.java 
b/java/org/apache/coyote/CompressionConfig.java
index 520ed2e..8bb11f9 100644
--- a/java/org/apache/coyote/CompressionConfig.java
+++ b/java/org/apache/coyote/CompressionConfig.java
@@ -46,6 +46,7 @@ public class CompressionConfig {
 
"text/javascript,application/javascript,application/json,application/xml";
 private String[] compressibleMimeTypes = null;
 private int compressionMinSize = 2048;
+private boolean noCompressionStrongETag = true;
 
 
 /**
@@ -183,6 +184,35 @@ public class CompressionConfig {
 
 
 /**
+ * Determine if compression is disabled if the resource has a strong ETag.
+ *
+ * @return {@code true} if compression is disabled, otherwise {@code false}
+ *
+ * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
+ * {@code true}
+ */
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return noCompressionStrongETag;
+}
+
+
+/**
+ * Set whether compression is disabled for resources with a strong ETag.
+ *
+ * @param noCompressionStrongETag {@code true} if compression is disabled,
+ *otherwise {@code false}
+ *
+ * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
+ * {@code true}
+ */
+@Deprecated
+public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+this.noCompressionStrongETag = noCompressionStrongETag;
+}
+
+
+/**
  * Determines if compression should be enabled for the given response and 
if
  * it is, sets any necessary headers to mark it as such.
  *
@@ -235,6 +265,16 @@ public class CompressionConfig {
 }
 }
 
+// Check if the resource has a strong ETag
+if (noCompressionStrongETag) {
+String eTag = responseHeaders.getHeader("ETag");
+if (eTag != null && !eTag.trim().startsWith("W/")) {
+// Has an ETag that doesn't start with "W/..." so it must be a
+// strong ETag
+return false;
+}
+}
+
 // If processing reaches this far, the response might be compressed.
 // Therefore, set the Vary header to keep proxies happy
 ResponseUtil.addVaryFieldName(responseHeaders, "accept-encoding");
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 26aea33..4d65942 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -265,6 +265,16 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 }
 
 
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return compressionConfig.getNoCompressionStrongETag();
+}
+@Deprecated
+public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+}
+
+
 public boolean useCompression(Request request, Response response) {
 return compressionConfig.useCompression(request, response);
 }
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 694d424..0afb255 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -396,6 +396,16 @@ public class Http2Protocol implements UpgradeProtocol {
 }
 
 
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return compressi

[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 389231b  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag 
& gzip
389231b is described below

commit 389231bccaa28d9a4142b91bfcdecec9d2fa9764
Author: Mark Thomas 
AuthorDate: Thu Nov 28 14:44:20 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63932 ETag & gzip

By default, do not compress content that has a strong ETag. This
behaviour is configuration for the HTTP/1.1 and HTTP/2 connectors via
the new Connector attribute noCompressionStrongETag
---
 java/org/apache/coyote/CompressionConfig.java  | 40 ++
 .../coyote/http11/AbstractHttp11Protocol.java  | 10 ++
 java/org/apache/coyote/http2/Http2Protocol.java| 10 ++
 test/org/apache/coyote/TestCompressionConfig.java  | 33 ++
 webapps/docs/changelog.xml |  6 
 webapps/docs/config/http.xml   |  8 +
 webapps/docs/config/http2.xml  |  8 +
 7 files changed, 108 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/coyote/CompressionConfig.java 
b/java/org/apache/coyote/CompressionConfig.java
index 520ed2e..8bb11f9 100644
--- a/java/org/apache/coyote/CompressionConfig.java
+++ b/java/org/apache/coyote/CompressionConfig.java
@@ -46,6 +46,7 @@ public class CompressionConfig {
 
"text/javascript,application/javascript,application/json,application/xml";
 private String[] compressibleMimeTypes = null;
 private int compressionMinSize = 2048;
+private boolean noCompressionStrongETag = true;
 
 
 /**
@@ -183,6 +184,35 @@ public class CompressionConfig {
 
 
 /**
+ * Determine if compression is disabled if the resource has a strong ETag.
+ *
+ * @return {@code true} if compression is disabled, otherwise {@code false}
+ *
+ * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
+ * {@code true}
+ */
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return noCompressionStrongETag;
+}
+
+
+/**
+ * Set whether compression is disabled for resources with a strong ETag.
+ *
+ * @param noCompressionStrongETag {@code true} if compression is disabled,
+ *otherwise {@code false}
+ *
+ * @deprecated Will be removed in Tomcat 10 where it will be hard-coded to
+ * {@code true}
+ */
+@Deprecated
+public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+this.noCompressionStrongETag = noCompressionStrongETag;
+}
+
+
+/**
  * Determines if compression should be enabled for the given response and 
if
  * it is, sets any necessary headers to mark it as such.
  *
@@ -235,6 +265,16 @@ public class CompressionConfig {
 }
 }
 
+// Check if the resource has a strong ETag
+if (noCompressionStrongETag) {
+String eTag = responseHeaders.getHeader("ETag");
+if (eTag != null && !eTag.trim().startsWith("W/")) {
+// Has an ETag that doesn't start with "W/..." so it must be a
+// strong ETag
+return false;
+}
+}
+
 // If processing reaches this far, the response might be compressed.
 // Therefore, set the Vary header to keep proxies happy
 ResponseUtil.addVaryFieldName(responseHeaders, "accept-encoding");
diff --git a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
index 61d9a0c..70387b9 100644
--- a/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
+++ b/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
@@ -279,6 +279,16 @@ public abstract class AbstractHttp11Protocol extends 
AbstractProtocol {
 }
 
 
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return compressionConfig.getNoCompressionStrongETag();
+}
+@Deprecated
+public void setNoCompressionStrongEtag(boolean noCompressionStrongETag) {
+compressionConfig.setNoCompressionStrongEtag(noCompressionStrongETag);
+}
+
+
 public boolean useCompression(Request request, Response response) {
 return compressionConfig.useCompression(request, response);
 }
diff --git a/java/org/apache/coyote/http2/Http2Protocol.java 
b/java/org/apache/coyote/http2/Http2Protocol.java
index 9597b79..1f3dfe0 100644
--- a/java/org/apache/coyote/http2/Http2Protocol.java
+++ b/java/org/apache/coyote/http2/Http2Protocol.java
@@ -405,6 +405,16 @@ public class Http2Protocol implements UpgradeProtocol {
 }
 
 
+@Deprecated
+public boolean getNoCompressionStrongETag() {
+return compres

[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

--- Comment #6 from Mark Thomas  ---
Already done. Test build here:
http://people.apache.org/~markt/dev/v8.5.50-dev/

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63970] java.lang.ClassCastException: org.apache.catalina.webresources.CachedResource$CachedResourceURLConnection cannot be cast to java.net.JarURLConnection

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63970

--- Comment #5 from Dmitry Treskunov  ---
Hi, thanks for the build. We are using the 8.5.x version, could you please
backport the fix there? Otherwise, I can't test it

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63859] AJP cping/cpong mode failing on Tomcat 9.x

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63859

--- Comment #23 from Aurelien Pernoud  ---
There is absolutely no hurry !
I've been working for a week almost now and no errors...
I'll leave it like that in our environment for the full month, I will even try
to reactivate the full mode "A" in our test environment, and if it doesn't
happen anymore then I'll consider it fix ;)
Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Enable jrt protocol and allow module calls

2019-11-28 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 8995466  Enable jrt protocol and allow module calls
8995466 is described below

commit 8995466c4ddec92d2263b4f2824561d7c1f4f69e
Author: remm 
AuthorDate: Thu Nov 28 11:34:31 2019 +0100

Enable jrt protocol and allow module calls

This doesn't break, so don't noop it.
---
 java/org/apache/tomcat/util/compat/GraalCompat.java | 13 -
 webapps/docs/graal.xml  |  2 +-
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 4ae501d..9fb835a 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -17,8 +17,6 @@
 package org.apache.tomcat.util.compat;
 
 import java.io.IOException;
-import java.net.URL;
-import java.util.Deque;
 
 class GraalCompat extends Jre9Compat {
 
@@ -46,15 +44,4 @@ class GraalCompat extends Jre9Compat {
 public void disableCachingForJarUrlConnections() throws IOException {
 }
 
-@Override
-public void addBootModulePath(Deque classPathUrlsToProcess) {
-// No support for modules in native images
-}
-
-@Override
-public boolean isExported(Class type) {
-// No support for modules in native images so return true
-return true;
-}
-
 }
diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 6aea12c..0739428 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -135,7 +135,7 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
 --allow-incomplete-classpath --enable-https\
 
--initialize-at-build-time=org.eclipse.jdt,org.apache.el.parser.SimpleNode,javax.servlet.jsp.JspFactory,org.apache.jasper.servlet.JasperInitializer,org.apache.jasper.runtime.JspFactoryImpl\
 -H:+JNI -H:+ReportUnsupportedElementsAtRuntime\
--H:+ReportExceptionStackTraces -H:EnableURLProtocols=http,https,jar\
+-H:+ReportExceptionStackTraces 
-H:EnableURLProtocols=http,https,jar,jrt\
 -H:ConfigurationFileDirectories=$TOMCAT_MAVEN/target/\
 -H:ReflectionConfigurationFiles=$TOMCAT_MAVEN/tomcat-reflection.json\
 -H:ResourceConfigurationFiles=$TOMCAT_MAVEN/tomcat-resource.json\


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Support Java 11 in Graal Native Images

2019-11-28 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new f73e601  Support Java 11 in Graal Native Images
f73e601 is described below

commit f73e6012f2437f732f711ddf197ccf790d2a38fa
Author: remm 
AuthorDate: Thu Nov 28 11:24:38 2019 +0100

Support Java 11 in Graal Native Images

Add support for Graal 19.3, since Graal now has Java 9+ [without
modules], the jre9Available needs to be accurate and match the substrate
VM (otherwise the direct byte buffer cleaner will not be there).
Java 11 support needs Graal 19.3 and it solves a lot of the big problems
Tomcat had with Graal with SunEC (now actually always available) and
ALPN now works.
The Graal support should now be like the regular JVM: you can use either
Java 8 or Java 11.
---
 java/org/apache/tomcat/util/compat/GraalCompat.java | 15 ++-
 java/org/apache/tomcat/util/compat/JreCompat.java   |  2 +-
 webapps/docs/changelog.xml  |  3 +++
 webapps/docs/graal.xml  |  3 +--
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/GraalCompat.java 
b/java/org/apache/tomcat/util/compat/GraalCompat.java
index 53b67a1..4ae501d 100644
--- a/java/org/apache/tomcat/util/compat/GraalCompat.java
+++ b/java/org/apache/tomcat/util/compat/GraalCompat.java
@@ -17,8 +17,10 @@
 package org.apache.tomcat.util.compat;
 
 import java.io.IOException;
+import java.net.URL;
+import java.util.Deque;
 
-class GraalCompat extends JreCompat {
+class GraalCompat extends Jre9Compat {
 
 private static final boolean GRAAL;
 
@@ -44,4 +46,15 @@ class GraalCompat extends JreCompat {
 public void disableCachingForJarUrlConnections() throws IOException {
 }
 
+@Override
+public void addBootModulePath(Deque classPathUrlsToProcess) {
+// No support for modules in native images
+}
+
+@Override
+public boolean isExported(Class type) {
+// No support for modules in native images so return true
+return true;
+}
+
 }
diff --git a/java/org/apache/tomcat/util/compat/JreCompat.java 
b/java/org/apache/tomcat/util/compat/JreCompat.java
index b33175b..cea18fb 100644
--- a/java/org/apache/tomcat/util/compat/JreCompat.java
+++ b/java/org/apache/tomcat/util/compat/JreCompat.java
@@ -49,7 +49,7 @@ public class JreCompat {
 if (GraalCompat.isSupported()) {
 instance = new GraalCompat();
 graalAvailable = true;
-jre9Available = false;
+jre9Available = Jre9Compat.isSupported();
 } else if (Jre9Compat.isSupported()) {
 instance = new Jre9Compat();
 graalAvailable = false;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2693403..c303810 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,9 @@
   
 Update the OWB module to Apache OpenWebBeans 2.0.13. (remm)
   
+  
+Support Java 11 in Graal Native Images with Graal 19.3+. (remm)
+  
 
   
 
diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index cb73078..6aea12c 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -145,8 +145,7 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
 
   
 Running the native image is then:
-./tomcat-maven-1.0 -Djava.library.path=$JAVA_HOME/jre/lib/amd64\
--Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties
+./tomcat-maven-1.0 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties
   
 
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Tomcat next and Jakarta EE

2019-11-28 Thread Rémy Maucherat
On Thu, Nov 28, 2019 at 10:51 AM Mark Thomas  wrote:

> On 27/11/2019 23:19, Rémy Maucherat wrote:
>
> 
>
> > Well, it sounds pretty good to me but the numbers are off and it's going
> > to be very very confusing. It pretty much has to be:
> > Tomcat X supporting Jakarta EE X
> > Tomcat X-1 supporting Jakarta EE X-1
> > Tomcat X-2 supporting Jakarta EE X-2
> > And Tomcat 9.X supporting Java EE 8 with the same Tomcat API as Tomcat X
> > [I understand the rationale for this to be able to achieve very long
> > term support - and I expect the API changes will likely be rather small
> > anyway -, for example 8.5 and 9.0 have diverged too much to keep 8.5
> > more stable, while if we had a 8.6 "trunk" to simply replace it
> > eventually we could have kept in strict sync with 9.0]
>
> I like it.
>
> > The only problem then (but it's a big one) is to accommodate the Tomcat
> > "10" supporting Jakarta EE 9 somewhere. Maybe 9.9 can be used for that
> > but it will still pollute a bit the 9.x message, it could be labelled as
> > a "Jakarta preview" or something maybe. Jakarta EE 9 is a useless
> > release anyway, nobody will use it and that Tomcat could almost be EOLed
> > immediately after a Jakarta EE 10 release.
>
> Hmm. Tricky.
>
> How about something like this?
>
> 10.0.0.M1 Jakarta EE 9
> 10.0.0.M2 Jakarta EE 9
> 10.0.0 Jakarta EE 9 stable
> 10.0.1.M1 Jakarta EE 10 dev
> 10.0.1.M2 Jakarta EE 10 dev
> 10.0.1.M3 Jakarta EE 10 dev
> 10.0.1.M4 Jakarta EE 10 dev
> 10.0.1.M5 Jakarta EE 10 dev
> 10.0.0.1 Jakarta EE 9 some urgent bug fix
> 10.0.1.M6 Jakarta EE 10 dev
> 10.0.1.M7 Jakarta EE 10 dev
> 10.0.1.M8 Jakarta EE 10 dev
> 10.0.1Jakarta EE 10 stable
> ...
> 10.0.nJakarta EE 10 stable / Tomcat 10 stable / 10.0.0 is EOL
>

Good idea, I like it too. That Jakarta EE 9 is the ultimate transition
release so it would be fitting if it had the most transitional Tomcat
branch.

Are we done already ? That was fast :)

Rémy


Re: Tomcat next and Jakarta EE

2019-11-28 Thread Mark Thomas
On 27/11/2019 23:19, Rémy Maucherat wrote:



> Well, it sounds pretty good to me but the numbers are off and it's going
> to be very very confusing. It pretty much has to be:
> Tomcat X supporting Jakarta EE X
> Tomcat X-1 supporting Jakarta EE X-1
> Tomcat X-2 supporting Jakarta EE X-2
> And Tomcat 9.X supporting Java EE 8 with the same Tomcat API as Tomcat X
> [I understand the rationale for this to be able to achieve very long
> term support - and I expect the API changes will likely be rather small
> anyway -, for example 8.5 and 9.0 have diverged too much to keep 8.5
> more stable, while if we had a 8.6 "trunk" to simply replace it
> eventually we could have kept in strict sync with 9.0]

I like it.

> The only problem then (but it's a big one) is to accommodate the Tomcat
> "10" supporting Jakarta EE 9 somewhere. Maybe 9.9 can be used for that
> but it will still pollute a bit the 9.x message, it could be labelled as
> a "Jakarta preview" or something maybe. Jakarta EE 9 is a useless
> release anyway, nobody will use it and that Tomcat could almost be EOLed
> immediately after a Jakarta EE 10 release.

Hmm. Tricky.

How about something like this?

10.0.0.M1 Jakarta EE 9
10.0.0.M2 Jakarta EE 9
10.0.0 Jakarta EE 9 stable
10.0.1.M1 Jakarta EE 10 dev
10.0.1.M2 Jakarta EE 10 dev
10.0.1.M3 Jakarta EE 10 dev
10.0.1.M4 Jakarta EE 10 dev
10.0.1.M5 Jakarta EE 10 dev
10.0.0.1 Jakarta EE 9 some urgent bug fix
10.0.1.M6 Jakarta EE 10 dev
10.0.1.M7 Jakarta EE 10 dev
10.0.1.M8 Jakarta EE 10 dev
10.0.1Jakarta EE 10 stable
...
10.0.nJakarta EE 10 stable / Tomcat 10 stable / 10.0.0 is EOL

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Update with the release of Graal 19.3

2019-11-28 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new ab95586  Update with the release of Graal 19.3
ab95586 is described below

commit ab955860e6e92dc272911a67feee5706add62098
Author: remm 
AuthorDate: Thu Nov 28 10:39:11 2019 +0100

Update with the release of Graal 19.3

Java 9+ support in native images will need updates because at the moment
it sets the jre9Available flag to false. Of course since this is Graal
the Java 9 support has a small footprint: "oh, there's no module support
with native images".
---
 webapps/docs/graal.xml | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/webapps/docs/graal.xml b/webapps/docs/graal.xml
index 852de70..cb73078 100644
--- a/webapps/docs/graal.xml
+++ b/webapps/docs/graal.xml
@@ -57,7 +57,7 @@
   
 Download and install GraalVM. The first step is then to add the
 native-image tool.
-export JAVA_HOME=/absolute...path...to/graalvm-ce-x.y.z
+export JAVA_HOME=/absolute...path...to/graalvm-ce-javaX-x.y.z
 cd $JAVA_HOME/bin
 ./gu install native-image
 Download the Tomcat Maven packaging from
@@ -103,7 +103,7 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
   
 Run the GraalVM substrate VM using the trace agent:
 $JAVA_HOME/bin/java\
-
-agentlib:native-image-agent=trace-output=$TOMCAT_MAVEN/target/trace-file.json\
+-agentlib:native-image-agent=config-output-dir=$TOMCAT_MAVEN/target/\
 -Dcatalina.base=. 
-Djava.util.logging.config.file=conf/logging.properties\
 -jar target/tomcat-maven-1.0.jar
   
@@ -117,11 +117,7 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
   
 
   
-Once that is done, the VM may be shut down. The descriptors can now be
-generated from the trace file.
-$JAVA_HOME/bin/native-image-configure generate\
---trace-input=$TOMCAT_MAVEN/target/trace-file.json\
---output-dir=$TOMCAT_MAVEN/target
+The descriptors have now been generated in the agent output directory.
 At this point, further configuration must be made to add items that are
 not traced, including: base interfaces, resource bundles, BeanInfo based
 reflection, etc. Please refer to the Graal documentation for more
@@ -179,12 +175,11 @@ ant -Dwebapp.name=somewebapp -f 
graal-webapp.ant.xml
   
 Missing items for better Tomcat functionality:
 
-  Java 11: ALPN for TLS, TLS 1.3, etc
   BeanInfo support: BeanInfo use in JSP taglibs must be configured
 manually in descriptors
   Java serialization: Clustering, session persistence
-  Static linking configuration: JSSE elliptic curve support,
-tomcat-native support when creating an image with static linking
+  Static linking configuration: tomcat-native support when creating
+an image with static linking
   JMX: Tomcat monitoring and management
 
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 7.0.x updated: Add session attribute support to the authentication example

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
 new 4666a36  Add session attribute support to the authentication example
4666a36 is described below

commit 4666a36eb6a443d7d2b56395372f476447cf1755
Author: Mark Thomas 
AuthorDate: Thu Nov 28 09:26:55 2019 +

Add session attribute support to the authentication example

Primarily to demonstrate session persistence across restarts for
authenticated sessions.
---
 webapps/docs/changelog.xml|  5 +++
 webapps/examples/jsp/security/protected/index.jsp | 39 ---
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index fcef51b..fbc5504 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -67,6 +67,11 @@
 TestAsyncContextStateChanges test that caused it
 to hang indefinitely. (markt)
   
+  
+Add the ability to set and display session attributes in the JSP FORM
+authentication example to demonstrate session persistence across
+restarts for authenticated sessions. (markt)
+  
 
   
   
diff --git a/webapps/examples/jsp/security/protected/index.jsp 
b/webapps/examples/jsp/security/protected/index.jsp
index 1a80409..31122eb 100644
--- a/webapps/examples/jsp/security/protected/index.jsp
+++ b/webapps/examples/jsp/security/protected/index.jsp
@@ -14,6 +14,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
+<%@ page import="java.util.Enumeration" %>
 <%
   if (request.getParameter("logoff") != null) {
 session.invalidate();
@@ -64,17 +65,47 @@ in session <%= session.getId() %>
   }
 %>
 
-To check whether your username has been granted a particular role,
+To check whether your user name has been granted a particular role,
 enter it here:
 
 
+
 
 
 
-If you have configured this app for form-based authentication, you can log
-off by clicking
+To add some data to the authenticated session, enter it here:
+
+
+
+
+
+
+
+<%
+  String dataName = request.getParameter("dataName");
+  if (dataName != null) {
+session.setAttribute(dataName, request.getParameter("dataValue"));
+  }
+%>
+The authenticated session contains the following attributes:
+
+NameValue
+<%
+  Enumeration names = session.getAttributeNames();
+  while (names.hasMoreElements()) {
+String name = names.nextElement();
+%>
+<%= name %><%= session.getAttribute(name) %>
+<%
+  }
+%>
+
+
+
+If you have configured this application for form-based authentication, you can
+log off by clicking
 here.
-This should cause you to be returned to the logon page after the redirect
+This should cause you to be returned to the login page after the redirect
 that is performed.
 
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Add session attribute support to the authentication example

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 09b54e6  Add session attribute support to the authentication example
09b54e6 is described below

commit 09b54e62c0c10218763c78a3df6541ef002df8ee
Author: Mark Thomas 
AuthorDate: Thu Nov 28 09:26:55 2019 +

Add session attribute support to the authentication example

Primarily to demonstrate session persistence across restarts for
authenticated sessions.
---
 webapps/docs/changelog.xml|  5 
 webapps/examples/jsp/security/protected/index.jsp | 30 +++
 2 files changed, 35 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e738239..2ab8af7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -100,6 +100,11 @@
 of the Connector in the documentation web application.
 (markt)
   
+  
+Add the ability to set and display session attributes in the JSP FORM
+authentication example to demonstrate session persistence across
+restarts for authenticated sessions. (markt)
+  
 
   
   
diff --git a/webapps/examples/jsp/security/protected/index.jsp 
b/webapps/examples/jsp/security/protected/index.jsp
index eacf27a..31122eb 100644
--- a/webapps/examples/jsp/security/protected/index.jsp
+++ b/webapps/examples/jsp/security/protected/index.jsp
@@ -14,6 +14,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
+<%@ page import="java.util.Enumeration" %>
 <%
   if (request.getParameter("logoff") != null) {
 session.invalidate();
@@ -72,6 +73,35 @@ enter it here:
 
 
 
+To add some data to the authenticated session, enter it here:
+
+
+
+
+
+
+
+<%
+  String dataName = request.getParameter("dataName");
+  if (dataName != null) {
+session.setAttribute(dataName, request.getParameter("dataValue"));
+  }
+%>
+The authenticated session contains the following attributes:
+
+NameValue
+<%
+  Enumeration names = session.getAttributeNames();
+  while (names.hasMoreElements()) {
+String name = names.nextElement();
+%>
+<%= name %><%= session.getAttribute(name) %>
+<%
+  }
+%>
+
+
+
 If you have configured this application for form-based authentication, you can
 log off by clicking
 here.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Add session attribute support to the authentication example

2019-11-28 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new e10cfb7  Add session attribute support to the authentication example
e10cfb7 is described below

commit e10cfb78f6574aa83b8b46c9fd51cc3b34e1a95a
Author: Mark Thomas 
AuthorDate: Thu Nov 28 09:26:55 2019 +

Add session attribute support to the authentication example

Primarily to demonstrate session persistence across restarts for
authenticated sessions.
---
 webapps/docs/changelog.xml|  5 
 webapps/examples/jsp/security/protected/index.jsp | 30 +++
 2 files changed, 35 insertions(+)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8d9724e..2693403 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -96,6 +96,11 @@
 of the Connector in the documentation web application.
 (markt)
   
+  
+Add the ability to set and display session attributes in the JSP FORM
+authentication example to demonstrate session persistence across
+restarts for authenticated sessions. (markt)
+  
 
   
   
diff --git a/webapps/examples/jsp/security/protected/index.jsp 
b/webapps/examples/jsp/security/protected/index.jsp
index eacf27a..31122eb 100644
--- a/webapps/examples/jsp/security/protected/index.jsp
+++ b/webapps/examples/jsp/security/protected/index.jsp
@@ -14,6 +14,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --%>
+<%@ page import="java.util.Enumeration" %>
 <%
   if (request.getParameter("logoff") != null) {
 session.invalidate();
@@ -72,6 +73,35 @@ enter it here:
 
 
 
+To add some data to the authenticated session, enter it here:
+
+
+
+
+
+
+
+<%
+  String dataName = request.getParameter("dataName");
+  if (dataName != null) {
+session.setAttribute(dataName, request.getParameter("dataValue"));
+  }
+%>
+The authenticated session contains the following attributes:
+
+NameValue
+<%
+  Enumeration names = session.getAttributeNames();
+  while (names.hasMoreElements()) {
+String name = names.nextElement();
+%>
+<%= name %><%= session.getAttribute(name) %>
+<%
+  }
+%>
+
+
+
 If you have configured this application for form-based authentication, you can
 log off by clicking
 here.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63966] Charset of TLS message is hardcoded to ISO-8859-1.

2019-11-28 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63966

--- Comment #4 from Mark Thomas  ---
If you i18n the message that that needs to be driven by the user agent's locale
rather than the server locale which would make the whole process significantly
more complicated. I don't see that change being made for this feature.

I'm not against switching the hard-coded message to UTF-8 - that would be
consistent with Tomcat's use of UTF-8 elsewhere and would also be a slightly
shorter response.

What I am against is making this encoding configurable without an acceptable
justification for adding that complexity.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org