Refine search
protected ServerFilterConfiguration getHttpServerFilterConfiguration(Http http) { final ServerFilterConfiguration serverFilterConfiguration = new ServerFilterConfiguration(); serverFilterConfiguration.setScheme(http.getScheme()); serverFilterConfiguration.setPassTraceRequest(true); serverFilterConfiguration.setTraceEnabled(Boolean.valueOf(http.getTraceEnabled())); int maxRequestParameters; try { maxRequestParameters = Integer.parseInt(http.getMaxRequestParameters()); } catch (NumberFormatException nfe) { maxRequestParameters = Http.MAX_REQUEST_PARAMETERS; } serverFilterConfiguration.setMaxRequestParameters(maxRequestParameters); serverFilterConfiguration.setMaxFormPostSize(Integer.parseInt(http.getMaxPostSizeBytes())); serverFilterConfiguration.setMaxBufferedPostSize(Integer.parseInt(http.getMaxSavePostSizeBytes())); return serverFilterConfiguration; }
/** * @param request {@link Request} * * @return the {@link SessionManager} to be used. <tt>null</tt> value implies {@link DefaultSessionManager} */ protected SessionManager getSessionManager(final Request request) { return request.getHttpFilter().getConfiguration().getSessionManager(); }
@Override protected ServerFilterConfiguration getHttpServerFilterConfiguration(Http http) { // Set the default Glassfish error page generator final ServerFilterConfiguration config = super.getHttpServerFilterConfiguration(http); config.setDefaultErrorPageGenerator(new GlassfishErrorPageGenerator()); return config; }
handlerRequest = Request.create(); handlerRequest.parameters.setLimit(config.getMaxRequestParameters()); httpRequestInProgress.set(context, handlerRequest); final Response handlerResponse = handlerRequest.getResponse(); if (config.isGracefulShutdownSupported()) { HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 503, HttpStatus.SERVICE_UNAVAILABLE_503.getReasonPhrase(), "The server is being shutting down...", null); } else if (!config.isPassTraceRequest() && request.getMethod() == Method.TRACE) { onTraceRequest(handlerRequest, handlerResponse); } else if (!checkMaxPostSize(request.getContentLength())) { handlerResponse.getResponse().getProcessingState().setError(true); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 413, HttpStatus.REQUEST_ENTITY_TOO_LARGE_413.getReasonPhrase(), "The request payload size exceeds the max post size limitation", null); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(),
inputBuffer.initialize(this, ctx); parameters.setHeaders(request.getHeaders()); parameters.setQuery(request.getQueryStringDC()); final DataChunk remoteUser = request.remoteUser(); parameters.setQueryStringEncoding(configuration.getDefaultQueryEncoding()); configuration.getBackendConfiguration(); setUserPrincipal(new GrizzlyPrincipal(remoteUser.toString()));
builder.add(fileCacheFilter); final ServerFilterConfiguration config = new ServerFilterConfiguration(serverConfig); config.setSendFileEnabled(listener.isSendFileEnabled()); fileCache.setFileSendEnabled(listener.isSendFileEnabled()); config.setBackendConfiguration(listener.getBackendConfiguration()); config.setDefaultErrorPageGenerator(listener.getDefaultErrorPageGenerator()); config.setSessionManager(listener.getSessionManager()); config.setTraceEnabled(config.isTraceEnabled() || listener.isTraceEnabled()); config.setMaxFormPostSize(listener.getMaxFormPostSize()); config.setMaxBufferedPostSize(listener.getMaxBufferedPostSize());
protected ServerFilterConfiguration getHttpServerFilterConfiguration(Http http) { final ServerFilterConfiguration serverFilterConfiguration = new ServerFilterConfiguration(); final String scheme = http.getScheme(); final String schemeMapping = http.getSchemeMapping(); serverFilterConfiguration.setBackendConfiguration(backendConfiguration); serverFilterConfiguration.setPassTraceRequest(true); serverFilterConfiguration.setTraceEnabled(Boolean.valueOf(http.getTraceEnabled())); int maxRequestParameters; try { maxRequestParameters = Http.MAX_REQUEST_PARAMETERS; serverFilterConfiguration.setMaxRequestParameters(maxRequestParameters); serverFilterConfiguration.setMaxPostSize(Integer.parseInt(http.getMaxPostSizeBytes())); serverFilterConfiguration.setMaxFormPostSize(Integer.parseInt(http.getMaxFormPostSizeBytes())); serverFilterConfiguration.setMaxBufferedPostSize(Integer.parseInt(http.getMaxSavePostSizeBytes())); return serverFilterConfiguration;
/** * Returns the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing. * * @param request {@link Request} * * @return the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing */ protected ErrorPageGenerator getErrorPageGenerator(final Request request) { return request.getHttpFilter().getConfiguration().getDefaultErrorPageGenerator(); }
public ServerFilterConfiguration(final String serverName, final String serverVersion) { this.httpServerName = serverName; this.httpServerVersion = serverVersion; configureSendFileSupport(); defaultErrorPageGenerator = new DefaultErrorPageGenerator(); }
handlerRequest = Request.create(); handlerRequest.parameters.setLimit(config.getMaxRequestParameters()); httpRequestInProgress.set(context, handlerRequest); final Response handlerResponse = handlerRequest.getResponse(); if (config.isGracefulShutdownSupported()) { HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 503, HttpStatus.SERVICE_UNAVAILABLE_503.getReasonPhrase(), "The server is being shutting down...", null); } else if (!config.isPassTraceRequest() && request.getMethod() == Method.TRACE) { onTraceRequest(handlerRequest, handlerResponse); } else if (!checkMaxPostSize(request.getContentLength())) { handlerResponse.getResponse().getProcessingState().setError(true); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 413, HttpStatus.REQUEST_ENTITY_TOO_LARGE_413.getReasonPhrase(), "The request payload size exceeds the max post size limitation", null); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(),
inputBuffer.initialize(this, ctx); parameters.setHeaders(request.getHeaders()); parameters.setQuery(request.getQueryStringDC()); final DataChunk remoteUser = request.remoteUser(); parameters.setQueryStringEncoding(configuration.getDefaultQueryEncoding()); configuration.getBackendConfiguration(); setUserPrincipal(new GrizzlyPrincipal(remoteUser.toString()));
builder.add(fileCacheFilter); final ServerFilterConfiguration config = new ServerFilterConfiguration(serverConfig); config.setSendFileEnabled(listener.isSendFileEnabled()); fileCache.setFileSendEnabled(listener.isSendFileEnabled()); config.setBackendConfiguration(listener.getBackendConfiguration()); config.setDefaultErrorPageGenerator(listener.getDefaultErrorPageGenerator()); config.setSessionManager(listener.getSessionManager()); config.setTraceEnabled(config.isTraceEnabled() || listener.isTraceEnabled()); config.setMaxFormPostSize(listener.getMaxFormPostSize()); config.setMaxBufferedPostSize(listener.getMaxBufferedPostSize());
/** * Returns the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing. * * @param request {@link Request} * * @return the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing */ protected ErrorPageGenerator getErrorPageGenerator(final Request request) { return request.getHttpFilter().getConfiguration().getDefaultErrorPageGenerator(); }
public ServerFilterConfiguration(final String serverName, final String serverVersion) { this.httpServerName = serverName; this.httpServerVersion = serverVersion; configureSendFileSupport(); defaultErrorPageGenerator = new DefaultErrorPageGenerator(); }
handlerRequest = Request.create(); handlerRequest.parameters.setLimit(config.getMaxRequestParameters()); httpRequestInProgress.set(context, handlerRequest); final Response handlerResponse = handlerRequest.getResponse(); if (config.isGracefulShutdownSupported()) { HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 503, HttpStatus.SERVICE_UNAVAILABLE_503.getReasonPhrase(), "The server is being shutting down...", null); } else if (!config.isPassTraceRequest() && request.getMethod() == Method.TRACE) { onTraceRequest(handlerRequest, handlerResponse); } else if (!checkMaxPostSize(request.getContentLength())) { handlerResponse.getResponse().getProcessingState().setError(true); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 413, HttpStatus.REQUEST_ENTITY_TOO_LARGE_413.getReasonPhrase(), "The request payload size exceeds the max post size limitation", null); HtmlHelper.setErrorAndSendErrorPage( handlerRequest, handlerResponse, config.getDefaultErrorPageGenerator(), 500, HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(), HttpStatus.INTERNAL_SERVER_ERROR_500.getReasonPhrase(),
inputBuffer.initialize(this, ctx); parameters.setHeaders(request.getHeaders()); parameters.setQuery(request.getQueryStringDC()); final DataChunk remoteUser = request.remoteUser(); parameters.setQueryStringEncoding(configuration.getDefaultQueryEncoding()); configuration.getBackendConfiguration(); setUserPrincipal(new GrizzlyPrincipal(remoteUser.toString()));
builder.add(fileCacheFilter); final ServerFilterConfiguration config = new ServerFilterConfiguration(serverConfig); config.setSendFileEnabled(listener.isSendFileEnabled()); fileCache.setFileSendEnabled(listener.isSendFileEnabled()); config.setBackendConfiguration(listener.getBackendConfiguration()); config.setDefaultErrorPageGenerator(listener.getDefaultErrorPageGenerator()); config.setSessionManager(listener.getSessionManager()); config.setTraceEnabled(config.isTraceEnabled() || listener.isTraceEnabled()); config.setMaxFormPostSize(listener.getMaxFormPostSize()); config.setMaxBufferedPostSize(listener.getMaxBufferedPostSize());
/** * @return Servlet-aware {@link SessionManager} */ @Override protected SessionManager getSessionManager(Request request) { final SessionManager sm = request.getHttpFilter() .getConfiguration().getSessionManager(); return sm != null ? sm : this.sessionManager; }
/** * Returns the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing. * * @param request {@link Request} * * @return the {@link ErrorPageGenerator}, that might be used * (if an error occurs) during {@link Request} processing */ protected ErrorPageGenerator getErrorPageGenerator(final Request request) { return request.getHttpFilter().getConfiguration().getDefaultErrorPageGenerator(); }
public ServerFilterConfiguration(final String serverName, final String serverVersion) { this.httpServerName = serverName; this.httpServerVersion = serverVersion; configureSendFileSupport(); defaultErrorPageGenerator = new DefaultErrorPageGenerator(); }