public static ServletRequest getServletRequest()

in tiles-request-servlet/src/main/java/org/apache/tiles/request/servlet/ServletUtil.java [90:105]


    public static ServletRequest getServletRequest(Request request) {
        Request currentRequest = request;
        while (true) {
            if (currentRequest == null) {
                throw new NotAServletEnvironmentException("Last Tiles request context is null");
            }

            if (currentRequest instanceof ServletRequest) {
                return (ServletRequest) currentRequest;
            }
            if (!(currentRequest instanceof RequestWrapper)) {
                throw new NotAServletEnvironmentException("Not a Servlet environment, not supported");
            }
            currentRequest = ((RequestWrapper) currentRequest).getWrappedRequest();
        }
    }