/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#REQUEST} */ public static DispatchType isRequest() { return new DispatchType(DispatcherType.REQUEST); }
@Override public boolean evaluateHttp(final HttpServletRewrite event, final EvaluationContext context) { if (this.type.equals(getDispatcherType(event))) { return true; } return false; }
/** * Determines the {@link DispatcherType} of the current request using the {@link DispatcherTypeProvider} SPI. */ private DispatcherType getDispatcherType(final HttpServletRewrite event) { for (DispatcherTypeProvider provider : getDispatcherTypeProviders(event)) { DispatcherType dispatcherType = provider.getDispatcherType(event.getRequest(), event.getServletContext()); if (dispatcherType != null) { return dispatcherType; } } throw new IllegalStateException("Unable to determine dispatcher type of current request"); }
else if (inboundCorrection && resourcePath.andNot(DispatchType.isForward()).evaluate(event, context))
@Override public boolean evaluateHttp(final HttpServletRewrite event, final EvaluationContext context) { if (this.type.equals(getDispatcherType(event))) { return true; } return false; }
/** * Determines the {@link DispatcherType} of the current request using the {@link DispatcherTypeProvider} SPI. */ private DispatcherType getDispatcherType(final HttpServletRewrite event) { for (DispatcherTypeProvider provider : getDispatcherTypeProviders(event)) { DispatcherType dispatcherType = provider.getDispatcherType(event.getRequest(), event.getServletContext()); if (dispatcherType != null) { return dispatcherType; } } throw new IllegalStateException("Unable to determine dispatcher type of current request"); }
else if (inboundCorrection && resourcePath.andNot(DispatchType.isForward()).evaluate(event, context))
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#ASYNC} */ public static DispatchType isAsync() { return new DispatchType(DispatcherType.ASYNC); }
@Override public boolean evaluateHttp(final HttpServletRewrite event, final EvaluationContext context) { if (this.type.equals(getDispatcherType(event))) { return true; } return false; }
/** * Determines the {@link DispatcherType} of the current request using the {@link DispatcherTypeProvider} SPI. */ private DispatcherType getDispatcherType(final HttpServletRewrite event) { for (DispatcherTypeProvider provider : getDispatcherTypeProviders(event)) { DispatcherType dispatcherType = provider.getDispatcherType(event.getRequest(), event.getServletContext()); if (dispatcherType != null) { return dispatcherType; } } throw new IllegalStateException("Unable to determine dispatcher type of current request"); }
else if (inboundCorrection && resourcePath.andNot(DispatchType.isForward()).evaluate(event, context))
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#FORWARD} */ public static DispatchType isForward() { return new DispatchType(DispatcherType.FORWARD); }
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#ASYNC} */ public static DispatchType isAsync() { return new DispatchType(DispatcherType.ASYNC); }
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#FORWARD} */ public static DispatchType isForward() { return new DispatchType(DispatcherType.FORWARD); }
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#INCLUDE} */ public static DispatchType isInclude() { return new DispatchType(DispatcherType.INCLUDE); }
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#INCLUDE} */ public static DispatchType isInclude() { return new DispatchType(DispatcherType.INCLUDE); }
/** * Create a {@link DispatchType} condition that ensures the current {@link HttpServletRewrite} is a * {@link DispatcherType#ERROR} */ public static DispatchType isError() { return new DispatchType(DispatcherType.ERROR); }