spring - Which classes of method argument may be annotated with @RequestHeader -


i want access time-stamp in if-modified-since header, can implement conditional get.

spring controllers can use @requestheader annotation indicate spring should pass value of http header handler method method argument. must argument string? or other classes permitted? spring documentation implies long values can converted. set of classes permitted?

will following work (using date)?

@requestmapping(method = requestmethod.get, headers = {"if-modified-since" }) public final void conditionallyretrieve(    @requestheader("if-modified-since")final date ifmodifiedsince,    final httpservletresponse response) {    ... } 

specifically, in example, think can use datetimeformat drive spring conversion:

@requestheader("if-modified-since")    @datetimeformat(pattern = "thepattern") final date ifmodifiedsince 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -