parent
42f72268cf
commit
21944ab95c
|
@ -2593,9 +2593,6 @@ public class ServletContextHandler extends ContextHandler implements Graceful
|
|||
@Override
|
||||
public Set<SessionTrackingMode> getDefaultSessionTrackingModes()
|
||||
{
|
||||
if (!_enabled)
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
if (_sessionHandler != null)
|
||||
return _sessionHandler.getDefaultSessionTrackingModes();
|
||||
return null;
|
||||
|
@ -2604,9 +2601,6 @@ public class ServletContextHandler extends ContextHandler implements Graceful
|
|||
@Override
|
||||
public Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
|
||||
{
|
||||
if (!_enabled)
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
if (_sessionHandler != null)
|
||||
return _sessionHandler.getEffectiveSessionTrackingModes();
|
||||
return null;
|
||||
|
@ -2698,9 +2692,7 @@ public class ServletContextHandler extends ContextHandler implements Graceful
|
|||
{
|
||||
if (!isStarting())
|
||||
throw new IllegalStateException();
|
||||
if (!_enabled)
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
|
||||
int timeout = -1;
|
||||
if (_sessionHandler != null)
|
||||
{
|
||||
|
@ -3259,9 +3251,6 @@ public class ServletContextHandler extends ContextHandler implements Graceful
|
|||
@Override
|
||||
public ClassLoader getClassLoader()
|
||||
{
|
||||
if (!_enabled)
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
// no security manager just return the classloader
|
||||
ClassLoader classLoader = ServletContextHandler.this.getClassLoader();
|
||||
if (!isUsingSecurityManager())
|
||||
|
|
|
@ -297,24 +297,24 @@ public class ServletContextHandlerTest
|
|||
try
|
||||
{
|
||||
sce.getServletContext().getDefaultSessionTrackingModes();
|
||||
sce.getServletContext().setAttribute("MyContextListener.defaultSessionTrackingModes", Boolean.FALSE);
|
||||
sce.getServletContext().setAttribute("MyContextListener.defaultSessionTrackingModes", Boolean.TRUE);
|
||||
}
|
||||
catch (UnsupportedOperationException e)
|
||||
{
|
||||
//Should NOT be able to call getDefaultSessionTrackingModes from programmatic SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.defaultSessionTrackingModes", Boolean.TRUE);
|
||||
//Servlet 6, should be able to call getDefaultSessionTrackingModes from programmatic SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.defaultSessionTrackingModes", Boolean.FALSE);
|
||||
}
|
||||
|
||||
assertNull(sce.getServletContext().getAttribute("MyContextListener.effectiveSessionTrackingModes"));
|
||||
try
|
||||
{
|
||||
sce.getServletContext().getEffectiveSessionTrackingModes();
|
||||
sce.getServletContext().setAttribute("MyContextListener.effectiveSessionTrackingModes", Boolean.FALSE);
|
||||
sce.getServletContext().setAttribute("MyContextListener.effectiveSessionTrackingModes", Boolean.TRUE);
|
||||
}
|
||||
catch (UnsupportedOperationException e)
|
||||
{
|
||||
//Should NOT be able to call getEffectiveSessionTrackingModes from programmatic SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.effectiveSessionTrackingModes", Boolean.TRUE);
|
||||
//Servlet 6,, should be able to call getEffectiveSessionTrackingModes from programmatic SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.effectiveSessionTrackingModes", Boolean.FALSE);
|
||||
}
|
||||
|
||||
assertNull(sce.getServletContext().getAttribute("MyContextListener.setSessionTrackingModes"));
|
||||
|
@ -345,12 +345,12 @@ public class ServletContextHandlerTest
|
|||
try
|
||||
{
|
||||
sce.getServletContext().getSessionTimeout();
|
||||
sce.getServletContext().setAttribute("MyContextListener.getSessionTimeout", Boolean.FALSE);
|
||||
sce.getServletContext().setAttribute("MyContextListener.getSessionTimeout", Boolean.TRUE);
|
||||
}
|
||||
catch (UnsupportedOperationException e)
|
||||
{
|
||||
//Should NOT be able to call getSessionTimeout from this SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.getSessionTimeout", Boolean.TRUE);
|
||||
//Servlet 6 should be able to call getSessionTimeout from this SCL
|
||||
sce.getServletContext().setAttribute("MyContextListener.getSessionTimeout", Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue