[Bug 69633] Filters mapped to "" are not applied to empty string ("") special URL pattern

2025-04-16 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=69633

--- Comment #5 from Grzegorz Grzybek  ---
Thanks

about
`org.apache.catalina.core.StandardContext#setMapperContextRootRedirectEnabled`
- it's `true` by default and that's how I use embedded Tomcat in Pax Web.
Similar to Jetty's
`org.eclipse.jetty.server.handler.ContextHandler#setAllowNullPathInContext` -
it's `false` by default (which means the same - redirect).

I agree that redirect should be the default, because Servlet API docs mention:

> http://host:port/ or http://host:port//

which kind of makes these cases equivalent.

-- 
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



Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


jengebr commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046872254


##
java/org/apache/jasper/runtime/JspRuntimeLibrary.java:
##
@@ -957,4 +957,21 @@ public static void releaseTag(Tag tag, InstanceManager 
instanceManager) {
 }
 
 }
+
+public static void nonstandardSetTag(jakarta.servlet.jsp.PageContext 
pageContext, String var, Object value) {
+if (value == null) {
+pageContext.removeAttribute(var);
+} else {
+pageContext.setAttribute(var, value);
+}
+}
+

Review Comment:
   Thank you, sorry, I missed the 3-arg vs. 4-arg distinction.  You're correct 
and I'll remove the 3-arg.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


jengebr commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046881926


##
java/org/apache/jasper/compiler/Generator.java:
##
@@ -3028,6 +3036,195 @@ public String 
generateNamedAttributeJspFragment(Node.NamedAttribute n, String ta
 
 return varName;
 }
+
+/**
+ * Determines whether a tag should be handled via nonstandard code 
(typically
+ * faster). Considers both configuration and level of support within 
Tomcat.
+ *
+ * Note that Tomcat is free to ignore any case it cannot handle, as 
long as it
+ * reports it accurately to the caller by returning false. For 
example, the
+ * initial implementation for c:set excludes support for body content. 
c:set
+ * tags with body content will be generated with the standard code and 
tags
+ * without body content will be generated via non-standard code.
+ * 
+ * @param n
+ * @param jspAttributes
+ * @return whether code was generated
+ * @throws JasperException
+ */
+private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n)
+throws JasperException {
+if (!nonstandardCustomTagNames.contains(n.getQName())) {
+// tag is not configured, move along
+return false;
+}
+
+Map jspAttributes = new HashMap<>();
+if (n.getJspAttributes() != null) {
+for (JspAttribute jspAttr : n.getJspAttributes()) {
+jspAttributes.put(jspAttr.getLocalName(), jspAttr);
+}
+}
+switch (n.qName) {
+case "c:set":
+// requires var and value, scope is optional, body is 
prohibited, value cannot be deferred
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& jspAttributes.containsKey("value")
+&& CORE_LIBS_URI.equals(n.getURI())) {
+// verify value is not a deferred expression
+String valueText = jspAttributes.get("value").getValue();
+if (valueText.startsWith("#")) {
+return false;
+} else if (jspAttributes.size() == 2
+|| (jspAttributes.size() == 3 && 
jspAttributes.containsKey("scope"))) {
+generateNonstandardSetLogic(n, jspAttributes);
+return true;
+}
+}
+break;
+case "c:remove":
+// requires var, scope is optional, body is prohibited
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& CORE_LIBS_URI.equals(n.getURI())
+&& (jspAttributes.size() == 1
+|| (jspAttributes.size() == 2
+&& jspAttributes.containsKey("scope" {
+generateNonstandardRemoveLogic(n, jspAttributes);
+return true;
+
+}
+break;
+default:
+// This indicates someone configured a tag with no 
non-standard implementation.
+// Harmless.
+}
+return false;
+}
+
+private void generateNonstandardSetLogic(Node.CustomTag n, Map jspAttributes)
+throws JasperException {
+String baseVar = createTagVarName(n.getQName(), n.getPrefix(), 
n.getLocalName());
+String tagMethod = "_jspx_meth_" + baseVar;
+ServletWriter outSave = out;
+
+// generate method call
+out.printin(tagMethod);
+out.print("(");
+out.print("_jspx_page_context");
+out.println(");");
+GenBuffer genBuffer = new GenBuffer(n, n.getBody());
+methodsBuffered.add(genBuffer);
+out = genBuffer.getOut();
+
+// Generate code for method declaration
+methodNesting++;
+out.println();
+out.pushIndent();
+out.printin("private void ");
+out.print(tagMethod);
+out.println("(jakarta.servlet.jsp.PageContext 
_jspx_page_context)");
+out.printil("throws java.lang.Throwable {");
+out.pushIndent();
+// Generated body of method
+out.printil("//  " + n.getQName());
+
+JspAttribute varAttribute = jspAttributes.get("var");
+Mark m = n.getStart();
+out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + 
m.getColumnNumber() + ") "
++ varAttribute.getTagAttributeInfo());
+
+JspAttribute valueAttribute = jspAttributes.get("value");
+m = n.getStart();
+

Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


markt-asf commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046909111


##
java/org/apache/jasper/compiler/Generator.java:
##
@@ -3028,6 +3036,195 @@ public String 
generateNamedAttributeJspFragment(Node.NamedAttribute n, String ta
 
 return varName;
 }
+
+/**
+ * Determines whether a tag should be handled via nonstandard code 
(typically
+ * faster). Considers both configuration and level of support within 
Tomcat.
+ *
+ * Note that Tomcat is free to ignore any case it cannot handle, as 
long as it
+ * reports it accurately to the caller by returning false. For 
example, the
+ * initial implementation for c:set excludes support for body content. 
c:set
+ * tags with body content will be generated with the standard code and 
tags
+ * without body content will be generated via non-standard code.
+ * 
+ * @param n
+ * @param jspAttributes
+ * @return whether code was generated
+ * @throws JasperException
+ */
+private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n)
+throws JasperException {
+if (!nonstandardCustomTagNames.contains(n.getQName())) {
+// tag is not configured, move along
+return false;
+}
+
+Map jspAttributes = new HashMap<>();
+if (n.getJspAttributes() != null) {
+for (JspAttribute jspAttr : n.getJspAttributes()) {
+jspAttributes.put(jspAttr.getLocalName(), jspAttr);
+}
+}
+switch (n.qName) {
+case "c:set":
+// requires var and value, scope is optional, body is 
prohibited, value cannot be deferred
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& jspAttributes.containsKey("value")
+&& CORE_LIBS_URI.equals(n.getURI())) {
+// verify value is not a deferred expression
+String valueText = jspAttributes.get("value").getValue();
+if (valueText.startsWith("#")) {
+return false;
+} else if (jspAttributes.size() == 2
+|| (jspAttributes.size() == 3 && 
jspAttributes.containsKey("scope"))) {
+generateNonstandardSetLogic(n, jspAttributes);
+return true;
+}
+}
+break;
+case "c:remove":
+// requires var, scope is optional, body is prohibited
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& CORE_LIBS_URI.equals(n.getURI())
+&& (jspAttributes.size() == 1
+|| (jspAttributes.size() == 2
+&& jspAttributes.containsKey("scope" {
+generateNonstandardRemoveLogic(n, jspAttributes);
+return true;
+
+}
+break;
+default:
+// This indicates someone configured a tag with no 
non-standard implementation.
+// Harmless.
+}
+return false;
+}
+
+private void generateNonstandardSetLogic(Node.CustomTag n, Map jspAttributes)
+throws JasperException {
+String baseVar = createTagVarName(n.getQName(), n.getPrefix(), 
n.getLocalName());
+String tagMethod = "_jspx_meth_" + baseVar;
+ServletWriter outSave = out;
+
+// generate method call
+out.printin(tagMethod);
+out.print("(");
+out.print("_jspx_page_context");
+out.println(");");
+GenBuffer genBuffer = new GenBuffer(n, n.getBody());
+methodsBuffered.add(genBuffer);
+out = genBuffer.getOut();
+
+// Generate code for method declaration
+methodNesting++;
+out.println();
+out.pushIndent();
+out.printin("private void ");
+out.print(tagMethod);
+out.println("(jakarta.servlet.jsp.PageContext 
_jspx_page_context)");
+out.printil("throws java.lang.Throwable {");
+out.pushIndent();
+// Generated body of method
+out.printil("//  " + n.getQName());
+
+JspAttribute varAttribute = jspAttributes.get("var");
+Mark m = n.getStart();
+out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + 
m.getColumnNumber() + ") "
++ varAttribute.getTagAttributeInfo());
+
+JspAttribute valueAttribute = jspAttributes.get("value");
+m = n.getStart();
+  

Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


jengebr commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046912039


##
java/org/apache/jasper/runtime/JspRuntimeLibrary.java:
##
@@ -957,4 +957,21 @@ public static void releaseTag(Tag tag, InstanceManager 
instanceManager) {
 }
 
 }
+
+public static void nonstandardSetTag(jakarta.servlet.jsp.PageContext 
pageContext, String var, Object value) {
+if (value == null) {
+pageContext.removeAttribute(var);
+} else {
+pageContext.setAttribute(var, value);
+}
+}
+

Review Comment:
   I verified this by comparison to the JSTL tag and realized I missed some 
logic to clean up the VariableMapper.  I added that as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


jengebr commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046936079


##
java/org/apache/jasper/compiler/Generator.java:
##
@@ -3028,6 +3036,195 @@ public String 
generateNamedAttributeJspFragment(Node.NamedAttribute n, String ta
 
 return varName;
 }
+
+/**
+ * Determines whether a tag should be handled via nonstandard code 
(typically
+ * faster). Considers both configuration and level of support within 
Tomcat.
+ *
+ * Note that Tomcat is free to ignore any case it cannot handle, as 
long as it
+ * reports it accurately to the caller by returning false. For 
example, the
+ * initial implementation for c:set excludes support for body content. 
c:set
+ * tags with body content will be generated with the standard code and 
tags
+ * without body content will be generated via non-standard code.
+ * 
+ * @param n
+ * @param jspAttributes
+ * @return whether code was generated
+ * @throws JasperException
+ */
+private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n)
+throws JasperException {
+if (!nonstandardCustomTagNames.contains(n.getQName())) {
+// tag is not configured, move along
+return false;
+}
+
+Map jspAttributes = new HashMap<>();
+if (n.getJspAttributes() != null) {
+for (JspAttribute jspAttr : n.getJspAttributes()) {
+jspAttributes.put(jspAttr.getLocalName(), jspAttr);
+}
+}
+switch (n.qName) {
+case "c:set":
+// requires var and value, scope is optional, body is 
prohibited, value cannot be deferred
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& jspAttributes.containsKey("value")
+&& CORE_LIBS_URI.equals(n.getURI())) {
+// verify value is not a deferred expression
+String valueText = jspAttributes.get("value").getValue();
+if (valueText.startsWith("#")) {
+return false;
+} else if (jspAttributes.size() == 2
+|| (jspAttributes.size() == 3 && 
jspAttributes.containsKey("scope"))) {
+generateNonstandardSetLogic(n, jspAttributes);
+return true;
+}
+}
+break;
+case "c:remove":
+// requires var, scope is optional, body is prohibited
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& CORE_LIBS_URI.equals(n.getURI())
+&& (jspAttributes.size() == 1
+|| (jspAttributes.size() == 2
+&& jspAttributes.containsKey("scope" {
+generateNonstandardRemoveLogic(n, jspAttributes);
+return true;
+
+}
+break;
+default:
+// This indicates someone configured a tag with no 
non-standard implementation.
+// Harmless.
+}
+return false;
+}
+
+private void generateNonstandardSetLogic(Node.CustomTag n, Map jspAttributes)
+throws JasperException {
+String baseVar = createTagVarName(n.getQName(), n.getPrefix(), 
n.getLocalName());
+String tagMethod = "_jspx_meth_" + baseVar;
+ServletWriter outSave = out;
+
+// generate method call
+out.printin(tagMethod);
+out.print("(");
+out.print("_jspx_page_context");
+out.println(");");
+GenBuffer genBuffer = new GenBuffer(n, n.getBody());
+methodsBuffered.add(genBuffer);
+out = genBuffer.getOut();
+
+// Generate code for method declaration
+methodNesting++;
+out.println();
+out.pushIndent();
+out.printin("private void ");
+out.print(tagMethod);
+out.println("(jakarta.servlet.jsp.PageContext 
_jspx_page_context)");
+out.printil("throws java.lang.Throwable {");
+out.pushIndent();
+// Generated body of method
+out.printil("//  " + n.getQName());
+
+JspAttribute varAttribute = jspAttributes.get("var");
+Mark m = n.getStart();
+out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + 
m.getColumnNumber() + ") "
++ varAttribute.getTagAttributeInfo());
+
+JspAttribute valueAttribute = jspAttributes.get("value");
+m = n.getStart();
+

(tomcat) branch main updated (490c5871d6 -> 5ca117b919)

2025-04-16 Thread jengebr
This is an automated email from the ASF dual-hosted git repository.

jengebr pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


from 490c5871d6 Fix off by one validation logic for partial PUT ranges
 add c288103193 Adding nonstandard support for c:set and c:remove
 new 5ca117b919 Merge pull request #842 from jengebr/nonstandard_tags

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/jasper/EmbeddedServletOptions.java |  12 ++
 java/org/apache/jasper/JspC.java   |  19 ++
 java/org/apache/jasper/Options.java|   8 +
 java/org/apache/jasper/compiler/Generator.java | 227 +
 .../apache/jasper/runtime/JspRuntimeLibrary.java   |  27 +++
 test/jakarta/servlet/jsp/TesterPageContext.java|  12 +-
 .../jsp/TesterPageContextWithAttributes.java   | 121 +++
 test/org/apache/jasper/compiler/TestGenerator.java |  86 
 .../compiler/TestNonstandardTagPerformance.java| 156 ++
 .../jasper/runtime/TestJspRuntimeLibrary.java  |  37 +++-
 test/webapp/WEB-INF/web.xml|  28 +++
 .../generator/nonstandard/remove-01.jsp}   |  26 +--
 .../generator/nonstandard/remove-02.jsp}   |  26 +--
 .../generator/nonstandard/remove-03.jsp}   |  26 +--
 .../generator/nonstandard/remove-04.jsp}   |  26 +--
 .../generator/nonstandard/remove-05.jsp}   |  26 +--
 .../generator/nonstandard/set-01.jsp}  |  19 +-
 .../generator/nonstandard/set-02.jsp}  |  19 +-
 .../generator/nonstandard/set-03.jsp}  |  19 +-
 .../generator/nonstandard/set-04.jsp}  |  19 +-
 .../generator/nonstandard/set-05.jsp}  |  19 +-
 webapps/docs/changelog.xml |   5 +
 22 files changed, 815 insertions(+), 148 deletions(-)
 create mode 100644 
test/jakarta/servlet/jsp/TesterPageContextWithAttributes.java
 create mode 100644 
test/org/apache/jasper/compiler/TestNonstandardTagPerformance.java
 copy test/webapp/{bug6/bug64872-byte.jsp => 
jsp/generator/nonstandard/remove-01.jsp} (57%)
 copy test/webapp/{bug6/bug64872-byte.jsp => 
jsp/generator/nonstandard/remove-02.jsp} (57%)
 copy test/webapp/{bug6/bug64872-byte.jsp => 
jsp/generator/nonstandard/remove-03.jsp} (57%)
 copy test/webapp/{bug6/bug64872-byte.jsp => 
jsp/generator/nonstandard/remove-04.jsp} (57%)
 copy test/webapp/{bug6/bug64872-byte.jsp => 
jsp/generator/nonstandard/remove-05.jsp} (58%)
 copy test/webapp/{bug6/bug64872b-timeunit.jsp => 
jsp/generator/nonstandard/set-01.jsp} (70%)
 copy test/webapp/{bug6/bug64872b-timeunit.jsp => 
jsp/generator/nonstandard/set-02.jsp} (69%)
 copy test/webapp/{bug6/bug64872b-timeunit.jsp => 
jsp/generator/nonstandard/set-03.jsp} (69%)
 copy test/webapp/{bug6/bug64872b-timeunit.jsp => 
jsp/generator/nonstandard/set-04.jsp} (69%)
 copy test/webapp/{bug6/bug64872b-timeunit.jsp => 
jsp/generator/nonstandard/set-05.jsp} (68%)


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



Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


jengebr merged PR #842:
URL: https://github.com/apache/tomcat/pull/842


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



(tomcat) 01/01: Merge pull request #842 from jengebr/nonstandard_tags

2025-04-16 Thread jengebr
This is an automated email from the ASF dual-hosted git repository.

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

commit 5ca117b919515b4f8d810e458b898d35255c7da3
Merge: 490c5871d6 c288103193
Author: jengebr <73608737+jeng...@users.noreply.github.com>
AuthorDate: Wed Apr 16 14:53:40 2025 -0500

Merge pull request #842 from jengebr/nonstandard_tags

Adding nonstandard support for c:set and c:remove

 java/org/apache/jasper/EmbeddedServletOptions.java |  12 ++
 java/org/apache/jasper/JspC.java   |  19 ++
 java/org/apache/jasper/Options.java|   8 +
 java/org/apache/jasper/compiler/Generator.java | 227 +
 .../apache/jasper/runtime/JspRuntimeLibrary.java   |  27 +++
 test/jakarta/servlet/jsp/TesterPageContext.java|  12 +-
 .../jsp/TesterPageContextWithAttributes.java   | 121 +++
 test/org/apache/jasper/compiler/TestGenerator.java |  86 
 .../compiler/TestNonstandardTagPerformance.java| 156 ++
 .../jasper/runtime/TestJspRuntimeLibrary.java  |  37 +++-
 test/webapp/WEB-INF/web.xml|  28 +++
 .../webapp/jsp/generator/nonstandard/remove-01.jsp |  26 +++
 .../webapp/jsp/generator/nonstandard/remove-02.jsp |  26 +++
 .../webapp/jsp/generator/nonstandard/remove-03.jsp |  26 +++
 .../webapp/jsp/generator/nonstandard/remove-04.jsp |  26 +++
 .../webapp/jsp/generator/nonstandard/remove-05.jsp |  26 +++
 test/webapp/jsp/generator/nonstandard/set-01.jsp   |  22 ++
 test/webapp/jsp/generator/nonstandard/set-02.jsp   |  22 ++
 test/webapp/jsp/generator/nonstandard/set-03.jsp   |  22 ++
 test/webapp/jsp/generator/nonstandard/set-04.jsp   |  22 ++
 test/webapp/jsp/generator/nonstandard/set-05.jsp   |  22 ++
 webapps/docs/changelog.xml |   5 +
 22 files changed, 975 insertions(+), 3 deletions(-)

diff --cc webapps/docs/changelog.xml
index 653ef0f363,cb8ec31bd9..3cb02f44ca
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@@ -212,11 -198,12 +212,16 @@@
  compilerTargetVM have been updated to 21 to align with 
Java
  21 being the minimum Java version required for Tomcat 12. (markt)

+   
+ Add support for optimized execution of c:set and c:remove tags, when
+ activated via JSP servlet param useNonstandardTagOptimizations.
+ (jengebr)
+   

 +  
 +69635: Add support to jakarta.el.ImportHandler
 +for resolving inner classes. (markt)
 +  
  




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



Re: [PR] Adding nonstandard support for c:set and c:remove [tomcat]

2025-04-16 Thread via GitHub


markt-asf commented on code in PR #842:
URL: https://github.com/apache/tomcat/pull/842#discussion_r2046559471


##
java/org/apache/jasper/compiler/Generator.java:
##
@@ -3028,6 +3036,195 @@ public String 
generateNamedAttributeJspFragment(Node.NamedAttribute n, String ta
 
 return varName;
 }
+
+/**
+ * Determines whether a tag should be handled via nonstandard code 
(typically
+ * faster). Considers both configuration and level of support within 
Tomcat.
+ *
+ * Note that Tomcat is free to ignore any case it cannot handle, as 
long as it
+ * reports it accurately to the caller by returning false. For 
example, the
+ * initial implementation for c:set excludes support for body content. 
c:set
+ * tags with body content will be generated with the standard code and 
tags
+ * without body content will be generated via non-standard code.
+ * 
+ * @param n
+ * @param jspAttributes
+ * @return whether code was generated
+ * @throws JasperException
+ */
+private boolean visitPotentiallyNonstandardCustomTag(Node.CustomTag n)
+throws JasperException {
+if (!nonstandardCustomTagNames.contains(n.getQName())) {
+// tag is not configured, move along
+return false;
+}
+
+Map jspAttributes = new HashMap<>();
+if (n.getJspAttributes() != null) {
+for (JspAttribute jspAttr : n.getJspAttributes()) {
+jspAttributes.put(jspAttr.getLocalName(), jspAttr);
+}
+}
+switch (n.qName) {
+case "c:set":
+// requires var and value, scope is optional, body is 
prohibited, value cannot be deferred
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& jspAttributes.containsKey("value")
+&& CORE_LIBS_URI.equals(n.getURI())) {
+// verify value is not a deferred expression
+String valueText = jspAttributes.get("value").getValue();
+if (valueText.startsWith("#")) {
+return false;
+} else if (jspAttributes.size() == 2
+|| (jspAttributes.size() == 3 && 
jspAttributes.containsKey("scope"))) {
+generateNonstandardSetLogic(n, jspAttributes);
+return true;
+}
+}
+break;
+case "c:remove":
+// requires var, scope is optional, body is prohibited
+if (n.hasEmptyBody()
+&& jspAttributes.containsKey("var")
+&& CORE_LIBS_URI.equals(n.getURI())
+&& (jspAttributes.size() == 1
+|| (jspAttributes.size() == 2
+&& jspAttributes.containsKey("scope" {
+generateNonstandardRemoveLogic(n, jspAttributes);
+return true;
+
+}
+break;
+default:
+// This indicates someone configured a tag with no 
non-standard implementation.
+// Harmless.
+}
+return false;
+}
+
+private void generateNonstandardSetLogic(Node.CustomTag n, Map jspAttributes)
+throws JasperException {
+String baseVar = createTagVarName(n.getQName(), n.getPrefix(), 
n.getLocalName());
+String tagMethod = "_jspx_meth_" + baseVar;
+ServletWriter outSave = out;
+
+// generate method call
+out.printin(tagMethod);
+out.print("(");
+out.print("_jspx_page_context");
+out.println(");");
+GenBuffer genBuffer = new GenBuffer(n, n.getBody());
+methodsBuffered.add(genBuffer);
+out = genBuffer.getOut();
+
+// Generate code for method declaration
+methodNesting++;
+out.println();
+out.pushIndent();
+out.printin("private void ");
+out.print(tagMethod);
+out.println("(jakarta.servlet.jsp.PageContext 
_jspx_page_context)");
+out.printil("throws java.lang.Throwable {");
+out.pushIndent();
+// Generated body of method
+out.printil("//  " + n.getQName());
+
+JspAttribute varAttribute = jspAttributes.get("var");
+Mark m = n.getStart();
+out.printil("// " + m.getFile() + "(" + m.getLineNumber() + "," + 
m.getColumnNumber() + ") "
++ varAttribute.getTagAttributeInfo());
+
+JspAttribute valueAttribute = jspAttributes.get("value");
+m = n.getStart();
+  

Buildbot failure in on tomcat-12.0.x

2025-04-16 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/120/builds/522
Blamelist: John Engebretson , jengebr 
<73608737+jeng...@users.noreply.github.com>
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch main] 5ca117b919515b4f8d810e458b898d35255c7da3


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  shell_6: 0

  shell_7: 0

  compile: 1

  shell_8: 0

  shell_9: 0

  shell_10: 0

  shell_11: 0

  Rsync docs to nightlies.apache.org: 0

  shell_12: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 2

  shell_13: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


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