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

org.springframework.biz.web.servlet.module.AcceptHeaderModuleResolver Maven / Gradle / Ivy

There is a newer version: 3.3.x.20241003.RELEASE
Show newest version
package org.springframework.biz.web.servlet.module;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class AcceptHeaderModuleResolver extends AbstractModuleResolver {

	@Override
	public String resolveModule(HttpServletRequest request) {
		String module = request.getHeader("Accept-Module");
		if(module != null){
			return module;
		}
		return getDefaultModule();
	}

	@Override
	public void setModule(HttpServletRequest request, HttpServletResponse response, String moduleName) {
		throw new UnsupportedOperationException(
				"Cannot change HTTP accept header - use a different module resolution strategy");
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy