Jetty 12.1.x various updates to demos (#12089)
* Use standard servlet api 5 jar for servlet5-demos. * Also update servlet4 demos to standard spec api jar. Also remove needless printlns and use of StringUtil.
This commit is contained in:
parent
55dceb5481
commit
35bf336854
|
@ -26,9 +26,9 @@
|
||||||
<artifactId>jetty-util-ajax</artifactId>
|
<artifactId>jetty-util-ajax</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
<version>${ee8.jakarta.websocket.api.version}</version>
|
<version>${ee8.jakarta.websocket.api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -20,6 +20,12 @@
|
||||||
<version>${ee8.jakarta.annotation.api.version}</version>
|
<version>${ee8.jakarta.annotation.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet.jsp</groupId>
|
<groupId>jakarta.servlet.jsp</groupId>
|
||||||
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||||
|
@ -37,12 +43,6 @@
|
||||||
<artifactId>jetty-server</artifactId>
|
<artifactId>jetty-server</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
<ee9.module>jetty-servlet5-demo-jndi-webapp</ee9.module>
|
<ee9.module>jetty-servlet5-demo-jndi-webapp</ee9.module>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
|
@ -32,12 +38,6 @@
|
||||||
<version>${ee8.javax.mail.glassfish.version}</version>
|
<version>${ee8.javax.mail.glassfish.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -17,6 +17,12 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet.jsp</groupId>
|
<groupId>jakarta.servlet.jsp</groupId>
|
||||||
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||||
|
@ -29,12 +35,6 @@
|
||||||
<version>${ee8.jakarta.servlet.jsp.jstl.api.version}</version>
|
<version>${ee8.jakarta.servlet.jsp.jstl.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -14,6 +14,12 @@
|
||||||
<ee9.module>jetty-servlet5-demo-mock-resources</ee9.module>
|
<ee9.module>jetty-servlet5-demo-mock-resources</ee9.module>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
|
@ -26,12 +32,6 @@
|
||||||
<version>${ee8.javax.mail.glassfish.version}</version>
|
<version>${ee8.javax.mail.glassfish.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -32,15 +32,15 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jakarta.transaction-api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.transaction-api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee8.jetty.servlet.api.version}</version>
|
<version>${ee8.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
<version>${ee9.jakarta.websocket.api.version}</version>
|
<version>${ee9.jakarta.websocket.api.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -19,6 +19,12 @@
|
||||||
<version>${ee9.jakarta.annotation.api.version}</version>
|
<version>${ee9.jakarta.annotation.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet.jsp</groupId>
|
<groupId>jakarta.servlet.jsp</groupId>
|
||||||
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||||
|
@ -47,18 +53,6 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>jakarta.servlet</groupId>
|
|
||||||
<artifactId>jakarta.servlet-api</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -22,7 +22,6 @@ import jakarta.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServlet;
|
import jakarta.servlet.http.HttpServlet;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.eclipse.jetty.util.StringUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rego Servlet - tests being accessed from servlet 3.0 programmatic
|
* Rego Servlet - tests being accessed from servlet 3.0 programmatic
|
||||||
|
@ -163,9 +162,9 @@ public class RegTest extends HttpServlet
|
||||||
{
|
{
|
||||||
if (s == null)
|
if (s == null)
|
||||||
return "null";
|
return "null";
|
||||||
s = StringUtil.replace(s, "&", "&");
|
s = s.replace("&", "&");
|
||||||
s = StringUtil.replace(s, "<", "<");
|
s = s.replace("<", "<");
|
||||||
s = StringUtil.replace(s, ">", ">");
|
s = s.replace(">", ">");
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,6 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
@Override
|
@Override
|
||||||
public void attributeAdded(HttpSessionBindingEvent se)
|
public void attributeAdded(HttpSessionBindingEvent se)
|
||||||
{
|
{
|
||||||
// System.err.println("attributedAdded "+se);
|
|
||||||
|
|
||||||
_called.put("attributeAdded", new Throwable());
|
_called.put("attributeAdded", new Throwable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,20 +61,17 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
public void attributeAdded(ServletContextAttributeEvent scab)
|
public void attributeAdded(ServletContextAttributeEvent scab)
|
||||||
{
|
{
|
||||||
_called.put("attributeAdded", new Throwable());
|
_called.put("attributeAdded", new Throwable());
|
||||||
// System.err.println("attributeAdded "+scab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attributeAdded(ServletRequestAttributeEvent srae)
|
public void attributeAdded(ServletRequestAttributeEvent srae)
|
||||||
{
|
{
|
||||||
_called.put("attributeAdded", new Throwable());
|
_called.put("attributeAdded", new Throwable());
|
||||||
// System.err.println("attributeAdded "+srae);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attributeRemoved(HttpSessionBindingEvent se)
|
public void attributeRemoved(HttpSessionBindingEvent se)
|
||||||
{
|
{
|
||||||
// System.err.println("attributeRemoved "+se);
|
|
||||||
_called.put("attributeRemoved", new Throwable());
|
_called.put("attributeRemoved", new Throwable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,20 +79,17 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
public void attributeRemoved(ServletContextAttributeEvent scab)
|
public void attributeRemoved(ServletContextAttributeEvent scab)
|
||||||
{
|
{
|
||||||
_called.put("attributeRemoved", new Throwable());
|
_called.put("attributeRemoved", new Throwable());
|
||||||
// System.err.println("attributeRemoved "+scab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attributeRemoved(ServletRequestAttributeEvent srae)
|
public void attributeRemoved(ServletRequestAttributeEvent srae)
|
||||||
{
|
{
|
||||||
_called.put("attributeRemoved", new Throwable());
|
_called.put("attributeRemoved", new Throwable());
|
||||||
// System.err.println("attributeRemoved "+srae);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attributeReplaced(HttpSessionBindingEvent se)
|
public void attributeReplaced(HttpSessionBindingEvent se)
|
||||||
{
|
{
|
||||||
// System.err.println("attributeReplaced "+se);
|
|
||||||
_called.put("attributeReplaced", new Throwable());
|
_called.put("attributeReplaced", new Throwable());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,28 +97,23 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
public void attributeReplaced(ServletContextAttributeEvent scab)
|
public void attributeReplaced(ServletContextAttributeEvent scab)
|
||||||
{
|
{
|
||||||
_called.put("attributeReplaced", new Throwable());
|
_called.put("attributeReplaced", new Throwable());
|
||||||
// System.err.println("attributeReplaced "+scab);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void attributeReplaced(ServletRequestAttributeEvent srae)
|
public void attributeReplaced(ServletRequestAttributeEvent srae)
|
||||||
{
|
{
|
||||||
_called.put("attributeReplaced", new Throwable());
|
_called.put("attributeReplaced", new Throwable());
|
||||||
// System.err.println("attributeReplaced "+srae);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextDestroyed(ServletContextEvent sce)
|
public void contextDestroyed(ServletContextEvent sce)
|
||||||
{
|
{
|
||||||
_called.put("contextDestroyed", new Throwable());
|
_called.put("contextDestroyed", new Throwable());
|
||||||
// System.err.println("contextDestroyed "+sce);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(ServletContextEvent sce)
|
public void contextInitialized(ServletContextEvent sce)
|
||||||
{
|
{
|
||||||
|
|
||||||
// System.err.println("contextInitialized "+sce);
|
|
||||||
_called.put("contextInitialized", new Throwable());
|
_called.put("contextInitialized", new Throwable());
|
||||||
|
|
||||||
//configure programmatic security
|
//configure programmatic security
|
||||||
|
@ -136,14 +123,12 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
ServletSecurity.TransportGuarantee.NONE, new String[]{"admin"});
|
ServletSecurity.TransportGuarantee.NONE, new String[]{"admin"});
|
||||||
ServletSecurityElement securityElement = new ServletSecurityElement(constraintElement, null);
|
ServletSecurityElement securityElement = new ServletSecurityElement(constraintElement, null);
|
||||||
Set<String> unchanged = rego.setServletSecurity(securityElement);
|
Set<String> unchanged = rego.setServletSecurity(securityElement);
|
||||||
//// System.err.println("Security constraints registered: "+unchanged.isEmpty());
|
|
||||||
|
|
||||||
//Test that a security constraint from web.xml can't be overridden programmatically
|
//Test that a security constraint from web.xml can't be overridden programmatically
|
||||||
ServletRegistration.Dynamic rego2 = sce.getServletContext().addServlet("RegoTest2", RegTest.class.getName());
|
ServletRegistration.Dynamic rego2 = sce.getServletContext().addServlet("RegoTest2", RegTest.class.getName());
|
||||||
rego2.addMapping("/rego2/*");
|
rego2.addMapping("/rego2/*");
|
||||||
securityElement = new ServletSecurityElement(constraintElement, null);
|
securityElement = new ServletSecurityElement(constraintElement, null);
|
||||||
unchanged = rego2.setServletSecurity(securityElement);
|
unchanged = rego2.setServletSecurity(securityElement);
|
||||||
//// System.err.println("Overridding web.xml constraints not possible:" +!unchanged.isEmpty());
|
|
||||||
|
|
||||||
/* For servlet 3.0 */
|
/* For servlet 3.0 */
|
||||||
FilterRegistration registration = sce.getServletContext().addFilter("TestFilter", TestFilter.class.getName());
|
FilterRegistration registration = sce.getServletContext().addFilter("TestFilter", TestFilter.class.getName());
|
||||||
|
@ -191,7 +176,6 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
_called.put("requestDestroyed", new Throwable());
|
_called.put("requestDestroyed", new Throwable());
|
||||||
((HttpServletRequest)sre.getServletRequest()).getSession(false);
|
((HttpServletRequest)sre.getServletRequest()).getSession(false);
|
||||||
sre.getServletRequest().setAttribute("requestInitialized", null);
|
sre.getServletRequest().setAttribute("requestInitialized", null);
|
||||||
// System.err.println("requestDestroyed "+sre);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -199,34 +183,29 @@ public class TestListener implements HttpSessionListener, HttpSessionAttributeLi
|
||||||
{
|
{
|
||||||
_called.put("requestInitialized", new Throwable());
|
_called.put("requestInitialized", new Throwable());
|
||||||
sre.getServletRequest().setAttribute("requestInitialized", "'" + sre.getServletContext().getContextPath() + "'");
|
sre.getServletRequest().setAttribute("requestInitialized", "'" + sre.getServletContext().getContextPath() + "'");
|
||||||
// System.err.println("requestInitialized "+sre);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sessionCreated(HttpSessionEvent se)
|
public void sessionCreated(HttpSessionEvent se)
|
||||||
{
|
{
|
||||||
_called.put("sessionCreated", new Throwable());
|
_called.put("sessionCreated", new Throwable());
|
||||||
// System.err.println("sessionCreated "+se);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sessionDestroyed(HttpSessionEvent se)
|
public void sessionDestroyed(HttpSessionEvent se)
|
||||||
{
|
{
|
||||||
_called.put("sessionDestroyed", new Throwable());
|
_called.put("sessionDestroyed", new Throwable());
|
||||||
// System.err.println("sessionDestroyed "+se);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sessionDidActivate(HttpSessionEvent se)
|
public void sessionDidActivate(HttpSessionEvent se)
|
||||||
{
|
{
|
||||||
// System.err.println("sessionDidActivate "+se);
|
|
||||||
_called.put("sessionDidActivate", new Throwable());
|
_called.put("sessionDidActivate", new Throwable());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sessionWillPassivate(HttpSessionEvent se)
|
public void sessionWillPassivate(HttpSessionEvent se)
|
||||||
{
|
{
|
||||||
// System.err.println("sessionWillPassivate "+se);
|
|
||||||
_called.put("sessionWillPassivate", new Throwable());
|
_called.put("sessionWillPassivate", new Throwable());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
<bundle-symbolic-name>${project.groupId}.servlet5.jndi</bundle-symbolic-name>
|
<bundle-symbolic-name>${project.groupId}.servlet5.jndi</bundle-symbolic-name>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
|
@ -31,12 +37,6 @@
|
||||||
<version>${ee9.javax.mail.glassfish.version}</version>
|
<version>${ee9.javax.mail.glassfish.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.servlet.jsp</groupId>
|
<groupId>jakarta.servlet.jsp</groupId>
|
||||||
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||||
|
@ -38,12 +44,6 @@
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -20,15 +20,15 @@
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jakarta.transaction-api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.transaction-api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -31,19 +31,18 @@
|
||||||
<version>${ee9.jakarta.annotation.api.version}</version>
|
<version>${ee9.jakarta.annotation.api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.servlet</groupId>
|
||||||
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.transaction</groupId>
|
<groupId>jakarta.transaction</groupId>
|
||||||
<artifactId>jakarta.transaction-api</artifactId>
|
<artifactId>jakarta.transaction-api</artifactId>
|
||||||
<version>${ee9.jakarta.transaction-api.version}</version>
|
<version>${ee9.jakarta.transaction-api.version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<span style="color:red; font-style:italic; font-weight:bold">Demo Web Application Only - Do NOT Deploy in Production</span>
|
<span style="color:red; font-style:italic; font-weight:bold">Demo Web Application Only - Do NOT Deploy in Production</span>
|
||||||
</center>
|
</center>
|
||||||
|
|
||||||
<h1>Servlet 5.0 Demo WebApp</h1>
|
<h1>Servlet Demo WebApp</h1>
|
||||||
<p>This example tests some aspects of the servlet specification:</p>
|
<p>This example tests some aspects of the servlet specification:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>context defaults</li>
|
<li>context defaults</li>
|
||||||
|
|
|
@ -18,9 +18,10 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jetty-jakarta-servlet-api</artifactId>
|
<artifactId>jakarta.servlet-api</artifactId>
|
||||||
<version>${ee9.jetty.servlet.api.version}</version>
|
<version>${ee9.jakarta.servlet.api.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -242,6 +242,7 @@
|
||||||
|
|
||||||
<ee8.jakarta.activation.api.version>1.2.2</ee8.jakarta.activation.api.version>
|
<ee8.jakarta.activation.api.version>1.2.2</ee8.jakarta.activation.api.version>
|
||||||
<ee8.jakarta.annotation.api.version>1.3.5</ee8.jakarta.annotation.api.version>
|
<ee8.jakarta.annotation.api.version>1.3.5</ee8.jakarta.annotation.api.version>
|
||||||
|
<ee8.jakarta.servlet.api.version>4.0.4</ee8.jakarta.servlet.api.version>
|
||||||
<ee8.jakarta.servlet.jsp.api.version>2.3.6</ee8.jakarta.servlet.jsp.api.version>
|
<ee8.jakarta.servlet.jsp.api.version>2.3.6</ee8.jakarta.servlet.jsp.api.version>
|
||||||
<ee8.jakarta.servlet.jsp.jstl.api.version>1.2.7</ee8.jakarta.servlet.jsp.jstl.api.version>
|
<ee8.jakarta.servlet.jsp.jstl.api.version>1.2.7</ee8.jakarta.servlet.jsp.jstl.api.version>
|
||||||
<ee8.jakarta.transaction-api.version>1.3.3</ee8.jakarta.transaction-api.version>
|
<ee8.jakarta.transaction-api.version>1.3.3</ee8.jakarta.transaction-api.version>
|
||||||
|
|
Loading…
Reference in New Issue