From da6ff9891a13304c67242581f168fa81e9bc1c25 Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Fri, 6 Dec 2024 07:42:23 -0600 Subject: [PATCH] Fixes #4323 - Set servlet-class to servlet-name if servlet-class is not specified (#4324) --- .../extension/webxml/internal/InternalWebXmlProcessor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/webxml/src/main/java/cloud/piranha/extension/webxml/internal/InternalWebXmlProcessor.java b/extension/webxml/src/main/java/cloud/piranha/extension/webxml/internal/InternalWebXmlProcessor.java index 760aaa11e..cb377b18a 100644 --- a/extension/webxml/src/main/java/cloud/piranha/extension/webxml/internal/InternalWebXmlProcessor.java +++ b/extension/webxml/src/main/java/cloud/piranha/extension/webxml/internal/InternalWebXmlProcessor.java @@ -514,6 +514,10 @@ private void processServlets(WebApplication webApplication, WebXml webXml) { if (!isEmpty(jspFile)) { dynamic = webApplication.addJspFile(servlet.getServletName(), jspFile); } else { + if (isEmpty(servlet.getClassName())) { + servlet.setClassName(servlet.getServletName()); + LOGGER.log(DEBUG, "Setting servlet-class from servlet-name"); + } dynamic = webApplication.addServlet(servlet.getServletName(), servlet.getClassName()); }