Package io.milton.annotations
Annotation Interface Get
Marks a method as one which generates content for the given resource
The method return type can be
- void, in which case you must write content to the outputStream in the method call
- a byte[] which is written to the output
- an InputStream, which will be written to output, then closed (in a try/finally block)
- a String, which is interpreted as a template name. The ViewResolver is used to locate a template with the given name, and it is invoked with a model object with name "resource"
- a
ModelAndViewwhich is passed to the ViewResolver to execute the template
The input parameters must be:
- first must be the source object
- then any of Request, Response, Range, contentType (String), parameters (Map), OutputStream
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionIf specified, will only match on requests with the given content typelongDefault is -1 which means use the system default.String[]If present, only requests which contain all of the given parameters will be matched
-
Element Details
-
contentType
String contentTypeIf specified, will only match on requests with the given content type- Returns:
- Default:
- ""
-
params
String[] paramsIf present, only requests which contain all of the given parameters will be matched- Returns:
- Default:
- {}
-
maxAgeSecs
long maxAgeSecsDefault is -1 which means use the system default. Returning 0 will explicitly disabled caching. Any other value is the number of seconds that the content may be cached by clients- Returns:
- Default:
- -1L
-