@Override
            protected ModelAndView handleRequestInternal(
                @Nonnull final HttpServletRequest request,
                @Nonnull final HttpServletResponse response) {
                val queryString = request.getQueryString();
                val url = request.getContextPath() + CasProtocolConstants.ENDPOINT_LOGIN
                    + Optional.ofNullable(queryString).map(value -> '?' + value).orElse(StringUtils.EMPTY);
                return new ModelAndView(new RedirectView(response.encodeURL(url)));
            }
This is {@link CasWebAppConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-webconfig/src/main/java/org/apereo/cas/config/CasWebAppConfiguration.java