當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestMethod.OPTIONS屬性代碼示例

本文整理匯總了Java中org.springframework.web.bind.annotation.RequestMethod.OPTIONS屬性的典型用法代碼示例。如果您正苦於以下問題:Java RequestMethod.OPTIONS屬性的具體用法?Java RequestMethod.OPTIONS怎麽用?Java RequestMethod.OPTIONS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.springframework.web.bind.annotation.RequestMethod的用法示例。


在下文中一共展示了RequestMethod.OPTIONS屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleResultsYML

@RequestMapping(value = "/**", method = RequestMethod.OPTIONS, produces = "application/x-yaml")
public Object handleResultsYML(HttpServletRequest request) {
	CollectionResources resource = handleResultsJson(request, Optional.empty());
	return new RamlBuilder(resource).build();

}
 
開發者ID:damianwajser,項目名稱:spring-rest-commons-options,代碼行數:6,代碼來源:OptionsController.java

示例2: doOptions

/**
 * Options for endpoint
 * @param response
 * @return the options
 */
@RequestMapping(method= RequestMethod.OPTIONS)
public @ResponseBody
EndpointOptions doOptions(HttpServletResponse response) {
	response.setHeader("Allow", options.getAllowedMethods());
	return options;
}
 
開發者ID:marrow16,項目名稱:ColorConverter,代碼行數:11,代碼來源:AbstractColorEndpoint.java

示例3: doOptions

/**
 * Options for endpoint
 * @param response
 * @return
 */
@RequestMapping(method= RequestMethod.OPTIONS)
public @ResponseBody EndpointOptions doOptions(HttpServletResponse response) {
	response.setHeader("Allow", options.getAllowedMethods());
	return options;
}
 
開發者ID:marrow16,項目名稱:ColorConverter,代碼行數:10,代碼來源:RootEndpoint.java

示例4: requestMappingUnprotectedAndProtectedUncommonMethods

/**
 * Mapping to several HTTP request methods is not OK if it's a mix of unprotected and protected HTTP request methods.
 */
@RequestMapping(value = "/request-mapping-unprotected-and-protected-uncommon-methods", method = {RequestMethod.OPTIONS, RequestMethod.PATCH})
public void requestMappingUnprotectedAndProtectedUncommonMethods() {
}
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:6,代碼來源:UnsafeSpringCsrfRequestMappingController.java

示例5: requestMappingAllUnprotectedMethodsAndOneProtectedMethod

/**
 * Mapping to several HTTP request methods is not OK if it's a mix of unprotected and protected HTTP request methods.
 */
@RequestMapping(value = "/request-mapping-all-unprotected-methods-and-one-protected-method",
        method = {RequestMethod.GET, RequestMethod.HEAD, RequestMethod.TRACE, RequestMethod.OPTIONS, RequestMethod.PATCH})
public void requestMappingAllUnprotectedMethodsAndOneProtectedMethod() {
}
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:7,代碼來源:UnsafeSpringCsrfRequestMappingController.java

示例6: requestMappingAllProtectedMethodsAndOneUnprotectedMethod

/**
 * Mapping to several HTTP request methods is not OK if it's a mix of unprotected and protected HTTP request methods.
 */
@RequestMapping(value = "/request-mapping-all-protected-methods-and-one-unprotected-method",
        method = {RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.PATCH, RequestMethod.OPTIONS})
public void requestMappingAllProtectedMethodsAndOneUnprotectedMethod() {
}
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:7,代碼來源:UnsafeSpringCsrfRequestMappingController.java

示例7: requestMappingOptions

/**
 * Mapping to the HTTP request method `OPTIONS` is safe as long as no state-changing operations are performed within this method.
 */
@RequestMapping(value = "/request-mapping-options", method = RequestMethod.OPTIONS)
public void requestMappingOptions() {
}
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:6,代碼來源:SafeSpringCsrfRequestMappingController.java

示例8: requestMappingSeveralUnprotectedMethods

/**
 * Mapping to several HTTP request methods is fine as long as all the HTTP request methods used are unprotected.
 */
@RequestMapping(value = "/request-mapping-several-unprotected-methods",
        method = {RequestMethod.GET, RequestMethod.HEAD, RequestMethod.TRACE, RequestMethod.OPTIONS})
public void requestMappingSeveralUnprotectedMethods() {
}
 
開發者ID:blackarbiter,項目名稱:Android_Code_Arbiter,代碼行數:7,代碼來源:SafeSpringCsrfRequestMappingController.java


注:本文中的org.springframework.web.bind.annotation.RequestMethod.OPTIONS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。