Tabnine Logo
org.springframework.web.bind.annotation
Code IndexAdd Tabnine to your IDE (free)

How to use org.springframework.web.bind.annotation

Best Java code snippets using org.springframework.web.bind.annotation (Showing top 20 results out of 25,902)

origin: spring-projects/spring-framework

  @RequestMapping(value = "/something", method = RequestMethod.PATCH)
  @ResponseBody
  public String handlePartialUpdate(@RequestBody String content) throws IOException {
    return content;
  }
}
origin: spring-projects/spring-framework

@RequestMapping(value = "/{id}/foo")
HttpEntity<Void> methodForNextPage(@PathVariable String id,
    @RequestParam Integer offset, @RequestParam Integer limit) {
  return null;
}
origin: spring-projects/spring-framework

@Override
@RequestMapping(value = "/path1/path2", method = RequestMethod.POST)
// NOTE: @ModelAttribute will NOT be found on the abstract superclass if
// @RequestMapping is declared locally. Thus, we have to redeclare
// @ModelAttribute locally as well.
@ModelAttribute("attr2")
public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception {
  return date;
}
origin: spring-projects/spring-framework

@RestController
@RequestMapping("/user")
static class UserController {
  @GetMapping("/{id}")
  public Principal getUser() {
    return mock(Principal.class);
  }
}
origin: spring-projects/spring-framework

  @RequestMapping("/notImplemented")
  @ResponseStatus(NOT_IMPLEMENTED)
  public @ResponseBody void notImplemented(){
  }
}
origin: spring-projects/spring-framework

  @RequestMapping("/{country}")
  HttpEntity<Void> getAddressesForCountry(@PathVariable String country) {
    return null;
  }
}
origin: spring-projects/spring-framework

  @RequestMapping("/myPath.do")
  public void myHandle(@RequestParam(value = "id", required = true) int id,
      @RequestHeader(value = "header", required = true) String header) {
  }
}
origin: spring-projects/spring-framework

  @RequestMapping(value="/blog.atom", method = { GET, HEAD })
  @ResponseBody
  public String listPublishedPosts() {
    return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"
        + "<feed xmlns=\"http://www.w3.org/2005/Atom\">\r\n"
        + "  <title>Test Feed</title>\r\n"
        + "  <icon>http://www.example.com/favicon.ico</icon>\r\n"
        + "</feed>\r\n\r\n";
  }
}
origin: spring-projects/spring-framework

@RequestMapping(value = "/path1/path2", method = RequestMethod.POST)
@ModelAttribute("attr2")
public Date handle(C date, Model model) throws Exception {
  return (Date) date;
}
origin: spring-projects/spring-framework

@CrossOrigin(origins = { "http://site1.com", "http://site2.com" },
    allowedHeaders = { "header1", "header2" },
    exposedHeaders = { "header3", "header4" },
    methods = RequestMethod.DELETE,
    maxAge = 123,
    allowCredentials = "false")
@RequestMapping(path = "/customized", method = { RequestMethod.GET, RequestMethod.POST })
public void customized() {
}
origin: spring-projects/spring-framework

@CrossOrigin
@GetMapping(path = "/ambiguous-produces", produces = "application/xml")
public String ambiguousProducesXml() {
  return "<a></a>";
}
origin: spring-projects/spring-framework

@RequestMapping(value = "/something", method = RequestMethod.PUT)
@ResponseBody
public String handle(@RequestBody String body) throws IOException {
  return body;
}
origin: spring-projects/spring-framework

@RequestMapping(value = "/{id}/foo")
HttpEntity<Void> methodWithMultiValueRequestParams(@PathVariable String id,
    @RequestParam List<Integer> items, @RequestParam Integer limit) {
  return null;
}
origin: spring-projects/spring-framework

@Override
@RequestMapping(value="/path1/path2", method=RequestMethod.POST)
@ModelAttribute("attr2")
public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception {
  return date;
}
origin: spring-projects/spring-framework

  @RequestMapping(value="/handleUtf8", produces="text/plain;charset=UTF-8")
  @ResponseBody
  public String handleWithCharset() {
    return "\u3053\u3093\u306b\u3061\u306f\u4e16\u754c\uff01";	// "Hello world! (Japanese)
  }
}
origin: spring-projects/spring-framework

  @Override
  @RequestMapping(method = RequestMethod.POST)
  public String post(@ModelAttribute("object1") TestBean object1) {
    //do something with object1
    return "page2";
  }
}
origin: spring-projects/spring-framework

  @CrossOrigin(allowCredentials = "bogus")
  @RequestMapping("/bogus")
  public void bogusAllowCredentialsValue() {
  }
}
origin: spring-projects/spring-framework

  @RequestMapping(value = "/something", method = RequestMethod.PUT, produces = "text/plain")
  @ResponseBody
  public String handle(@RequestBody String body) throws IOException {
    return body;
  }
}
origin: spring-projects/spring-framework

@RequestMapping(value="/path1/path2", method=RequestMethod.POST)
@ModelAttribute("attr2")
public Date handle(@RequestHeader("header2") Date date) throws Exception {
  return date;
}
origin: spring-projects/spring-framework

@RequestMapping(value="/path2", method=RequestMethod.POST)
@ModelAttribute("attr2")
public Date handle(@RequestHeader("header2") Date date, Model model) throws Exception {
  return date;
}
org.springframework.web.bind.annotation

Most used classes

  • RequestMapping
  • RestController
  • PathVariable
  • GetMapping
  • RequestParam
  • ResponseBody,
  • PostMapping,
  • ExceptionHandler,
  • ResponseStatus,
  • ControllerAdvice,
  • PutMapping,
  • DeleteMapping,
  • ModelAttribute,
  • RequestHeader,
  • RequestMethod,
  • CrossOrigin,
  • InitBinder,
  • RestControllerAdvice,
  • CookieValue
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now