Java Code Examples for org.springframework.web.bind.annotation.RequestMethod#TRACE

The following examples show how to use org.springframework.web.bind.annotation.RequestMethod#TRACE . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Error handler.
 *
 * @return Unauthorized (401), Forbidden (403) or Not Found (404) with no body.
 */
@RequestMapping(value = "/error", method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT,
        RequestMethod.DELETE, RequestMethod.HEAD, RequestMethod.OPTIONS, RequestMethod.PATCH, RequestMethod.TRACE})
public ResponseEntity<?> error() {

    Map<String, Object> requestErrorAttributes = errorAttributes.getErrorAttributes(
            new ServletWebRequest(request), ErrorAttributeOptions.defaults());
    HttpStatus errorStatus = HttpStatus.valueOf((Integer) requestErrorAttributes.get("status"));

    if (HttpStatus.UNAUTHORIZED.equals(errorStatus) || HttpStatus.FORBIDDEN.equals(errorStatus)) {
        session.invalidate();
        return new ResponseEntity<>(errorStatus);
    } else {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }

}
 
Example 2
Source Project: zstack   File: TestLibController.java    License: Apache License 2.0 5 votes vote down vote up
@RequestMapping(
        value = "/**",
        method = {
                RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE, RequestMethod.GET,
                RequestMethod.HEAD, RequestMethod.OPTIONS, RequestMethod.PATCH, RequestMethod.TRACE
        }
)
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
    Test.handleHttp(request, response);
}
 
Example 3
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 4
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 5
/**
 * 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() {
}
 
Example 6
/**
 * Mapping to the HTTP request method `TRACE` is safe as long as no state-changing operations are performed within this method.
 */
@RequestMapping(value = "/request-mapping-trace", method = RequestMethod.TRACE)
public void requestMappingTrace() {
}
 
Example 7
/**
 * 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() {
}
 
Example 8
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}
 
Example 9
@RequestMapping(value = "/myPath.do", method = RequestMethod.TRACE)
public void trace() {
}