org.cruxframework.crux.core.server.rest.annotation
Annotation Type RestService.CorsSupport


@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public static @interface RestService.CorsSupport

Annotation used to inform that a given rest service class must support CORS requests.

Author:
Thiago da Rosa de Bustamante

Required Element Summary
 int maxAge
          Specify a cache time for pre-flight CORS requests
 
Optional Element Summary
 boolean allowCredentials
          By default, cookies are not included in CORS requests.
 String[] allowOrigin
          Origins allowed to make cors requests to this service.
 String allowOriginConfigFile
          Origins allowed to make cors requests to this service.
 String[] exposeHeaders
          Cors requests can only access the following headers by default: Cache-Control, Content-Language Content-Type, Expires, Last-Modified and Pragma.
 

Element Detail

maxAge

public abstract int maxAge
Specify a cache time for pre-flight CORS requests

Returns:

allowOrigin

public abstract String[] allowOrigin
Origins allowed to make cors requests to this service.

Returns:
list of origins allowed
Default:
{}

allowOriginConfigFile

public abstract String allowOriginConfigFile
Origins allowed to make cors requests to this service. Inform a file name containing the origins allowed. The file must be visible into application's classpath and declare one origin per line of the raw text file specified.

Returns:
list of origins allowed
Default:
""

allowCredentials

public abstract boolean allowCredentials
By default, cookies are not included in CORS requests. Use this header to indicate that cookies should be included in CORS requests.

Returns:
true if this service allow credentials sharing.
Default:
false

exposeHeaders

public abstract String[] exposeHeaders
Cors requests can only access the following headers by default: Cache-Control, Content-Language Content-Type, Expires, Last-Modified and Pragma. If you want clients to be able to access other headers,use this property to expose them

Returns:
list of non default headers to expose to cors clients.
Default:
{}


Copyright © 2014. All rights reserved.