I am trying to find way through which, I can populate all Key values from @RequestHeader annotation to a Map. I tried to Google it but all I can find is a way to map each key value to one parameter.
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloController {
@RequestMapping(value = "/hello.htm")
public String hello(@RequestHeader(value="User-Agent") String userAgent)
//..
}
}
But I want to achieve something like this.
@RequestHeader Map headerParam;
So that I can traverse the Map and use all header values as required.