Example usage for org.springframework.web.bind.annotation RequestMethod OPTIONS

List of usage examples for org.springframework.web.bind.annotation RequestMethod OPTIONS

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod OPTIONS.

Prototype

RequestMethod OPTIONS

To view the source code for org.springframework.web.bind.annotation RequestMethod OPTIONS.

Click Source Link

Usage

From source file:com.sg.rest.controllers.OptionsController.java

@RequestMapping(method = RequestMethod.OPTIONS, value = "/**")
public void loginOptions(HttpServletResponse response) {
}

From source file:belajar.nfc.controller.OptionsController.java

@RequestMapping(value = "/{id}", method = RequestMethod.OPTIONS)
public void handleOptionsUserWithId(@PathVariable String id, HttpServletRequest request,
        HttpServletResponse response) {//from   w  w w .j a v  a2 s .c  o m
    String host = request.getHeader("Host");
    String origin = request.getHeader("Origin");
    LOGGER.info("Options Controller URI [{}] method [{}] headers [{}] ipserver [{}]",
            new Object[] { request.getRequestURI(), request.getMethod(), origin, host });
}

From source file:belajar.nfc.controller.OptionsController.java

@RequestMapping(method = RequestMethod.OPTIONS)
public void handleOptionsUser(HttpServletRequest request, HttpServletResponse response) {
    String host = request.getHeader("Host");
    String origin = request.getHeader("Origin");
    LOGGER.info("Options Controller URI [{}] method [{}] headers [{}] ipserver [{}]",
            new Object[] { request.getRequestURI(), request.getMethod(), origin, host });
}

From source file:net.eusashead.hateoas.springhalbuilder.controller.RootController.java

@RequestMapping(method = RequestMethod.OPTIONS)
public ResponseEntity<Void> options(OptionsResponseBuilder<Void> builder) {
    return builder.allow(HttpMethod.GET).build();
}

From source file:org.ow2.proactive.scheduling.api.controllers.ApiController.java

@RequestMapping(value = "/v1/rest", method = { RequestMethod.DELETE, RequestMethod.GET, RequestMethod.HEAD,
        RequestMethod.OPTIONS, RequestMethod.POST, RequestMethod.PUT, RequestMethod.TRACE })
@ResponseBody//from  www. java 2  s .  c  o m
public String v1() {
    return "TODO: forward to /rest/";
}

From source file:net.eusashead.hateoas.response.argumentresolver.EntityController.java

@RequestMapping(method = RequestMethod.OPTIONS)
public ResponseEntity<Entity> options(OptionsResponseBuilder<Entity> builder) {
    return builder.allow(HttpMethod.GET, HttpMethod.HEAD).entity(new Entity("foo")).build();
}

From source file:com.github.hateoas.forms.spring.uber.UberActionTest.java

@Test(expected = IllegalArgumentException.class)
public void translateOptionsFails() throws Exception {
    UberAction.forRequestMethod(RequestMethod.OPTIONS);
}

From source file:org.elasticsoftware.elasticactors.examples.springweb.controller.UserController.java

@ResponseBody
@RequestMapping(value = "/user/{uid}", method = { RequestMethod.GET, RequestMethod.HEAD,
        RequestMethod.OPTIONS })
public DeferredResult<UserDTO> getUser(@PathVariable String uid) throws Exception {
    log.info(String.format("Retrieving user[%s]", uid));
    final DeferredResult<UserDTO> result = new DeferredResult<>();
    ActorRef replyRef = actorSystem.tempActorOf(ReplyActor.class, new ActorDelegate<UserDTO>() {
        @Override//from  w  w  w.  j a v  a2 s . c  om
        public ActorDelegate<UserDTO> getBody() {
            return this;
        }

        @Override
        public void onReceive(ActorRef sender, UserDTO message) throws Exception {
            result.setResult(message);
        }
    });
    ActorRef user = actorSystem.actorOf(uid, User.class);
    user.tell(new Retrieve(uid), replyRef);
    return result;
}

From source file:github.priyatam.springrest.resource.PolicyResource.java

@RequestMapping(method = RequestMethod.OPTIONS, value = "/policy")
public ResponseEntity<Policy> options(HttpServletRequest arg0) {
    // TODO Return all the Links for the resource
    return null;//from   w w  w  . j  av a2s  . c o  m
}

From source file:net.eusashead.hateoas.springhalbuilder.controller.CustomerController.java

@RequestMapping(method = RequestMethod.OPTIONS)
public ResponseEntity<Void> options(OptionsResponseBuilder<Void> builder) {
    return builder.allow(HttpMethod.GET, HttpMethod.HEAD).build();
}