All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.webscripts.arguments.HttpServletRequestArgumentResolver Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.webscripts.arguments;

import javax.servlet.http.HttpServletRequest;

import com.github.dynamicextensionsalfresco.webscripts.WebScriptUtil;

import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;

public class HttpServletRequestArgumentResolver extends AbstractTypeBasedArgumentResolver {

	@Override
	protected Class getExpectedArgumentType() {
		return HttpServletRequest.class;
	}

	@Override
	protected HttpServletRequest resolveArgument(final WebScriptRequest request, final WebScriptResponse response) {
		final HttpServletRequest httpServletRequest = WebScriptUtil.extractHttpServletRequest(request);
		if (httpServletRequest == null) {
			throw new RuntimeException("Cannot extract HttpServletRequest from WebScriptRequest.");
		}
		return httpServletRequest;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy