本文整理汇总了Java中org.springframework.web.bind.annotation.RequestMethod.GET属性的典型用法代码示例。如果您正苦于以下问题:Java RequestMethod.GET属性的具体用法?Java RequestMethod.GET怎么用?Java RequestMethod.GET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.springframework.web.bind.annotation.RequestMethod
的用法示例。
在下文中一共展示了RequestMethod.GET属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: valueDescriptorsForDeviceByName
/**
* Retrieve value descriptors associated to a device where the device is identified by name - that
* is value descriptors that are listed as part of a devices parameter names on puts or expected
* values on get or put commands. Throws a ServcieException (HTTP 503) for unknown or
* unanticipated issues. Throws NotFoundExcetption (HTTP 404) if a device cannot be found for the
* name provided.
*
* @param name - name of the device
* @return list of value descriptors associated to the device.
* @throws ServcieException (HTTP 503) for unknown or unanticipated issues
* @throws NotFoundException (HTTP 404) for device not found by name
*/
@RequestMapping(value = "/devicename/{name:.+}", method = RequestMethod.GET)
@Override
public List<ValueDescriptor> valueDescriptorsForDeviceByName(@PathVariable String name) {
try {
Device device = deviceClient.deviceForName(name);
Set<String> vdNames = device.getProfile().getCommands().stream()
.map((Command cmd) -> cmd.associatedValueDescriptors()).flatMap(l -> l.stream())
.collect(Collectors.toSet());
return vdNames.stream().map(s -> this.valDescRepos.findByName(s))
.collect(Collectors.toList());
} catch (javax.ws.rs.NotFoundException nfE) {
throw new NotFoundException(Device.class.toString(), name);
} catch (Exception e) {
logger.error("Error getting value descriptor by device name: " + e.getMessage());
throw new ServiceException(e);
}
}
示例2: detail
@RequestMapping(value = "/{bookId}/detail", method = RequestMethod.GET)
private String detail(@PathVariable("bookId") Long bookId, Model model) {
if (bookId == null) {
return "redirect:/book/list";
}
Book book = bookService.getById(bookId);
if (book == null) {
return "forward:/book/list";
}
model.addAttribute("book", book);
return "detail";
}
示例3: homePage
@RequestMapping(value = "/HomePage", method = RequestMethod.GET)
public String homePage(HttpServletRequest request, Map<String, Object> map) {
Authentication authentication = JwtService
.getAuthentication((HttpServletRequest) request);
String username = authentication.getName();
logger.debug("username is :" + username);
String url = jdbcTemplate.queryForObject(SqlDefine.sys_rdbms_078, String.class, username);
url = url.replaceFirst("^./views/", "").replaceFirst(".tpl$", "");
logger.debug("url is :" + url);
map.put("userId", username);
return url;
}
示例4: articles
@RequestMapping(value="/category/{category}", method = RequestMethod.GET)
public String articles(@PathVariable("category") String category, Model model, RedirectAttributes attr){
if(!categoryService.isCategoryValid(category)){
attr.addFlashAttribute("error","Any article with that category does not exist!");
return "redirect:/oups";
}
model.addAttribute("userName", userService.getPrincipal());
model.addAttribute("activeCategory", category);
model.addAttribute("categories", categoryService.getCategories());
model.addAttribute("scrollUrl", "/get/category/"+category+"/");
return "home";
}
示例5: findReleaseByIds
@RequestMapping(value = "/releases", method = RequestMethod.GET)
public List<ReleaseDTO> findReleaseByIds(@RequestParam("releaseIds") String releaseIds) {
Set<Long> releaseIdSet = RELEASES_SPLITTER.splitToList(releaseIds).stream().map(Long::parseLong)
.collect(Collectors.toSet());
List<Release> releases = releaseService.findByReleaseIds(releaseIdSet);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
示例6: initForm
@RequestMapping(value={"/deptform.html", "/custom/deptform.html"}, method=RequestMethod.GET)
public String initForm(Model model){
DepartmentForm departmentForm = new DepartmentForm();
model.addAttribute("departmentForm", departmentForm);
return "dept_form";
}
示例7: doGet
@RequestMapping(method = RequestMethod.GET)
public String doGet(HttpServletRequest request, Model model) throws Exception {
Map<String, Object> map = new HashMap<>();
User user = securityService.getCurrentUser(request);
List<Playlist> playlists = playlistService.getReadablePlaylistsForUser(user.getUsername());
map.put("playlists", playlists);
model.addAttribute("model", map);
return "playlists";
}
示例8: getPublicAppNamespaceAllNamespaces
@RequestMapping(value = "/envs/{env}/appnamespaces/{publicNamespaceName}/namespaces", method = RequestMethod.GET)
public List<NamespaceDTO> getPublicAppNamespaceAllNamespaces(@PathVariable String env,
@PathVariable String publicNamespaceName,
@RequestParam(name = "page", defaultValue = "0") int page,
@RequestParam(name = "size", defaultValue = "10") int size) {
return namespaceService.getPublicAppNamespaceAllNamespaces(Env.fromString(env), publicNamespaceName, page, size);
}
示例9: stop
@RequestMapping(value = "spider/stop.do", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ResultBundle<String> stop(String uuid) {
return service.stop(uuid);
}
示例10: index
@RequestMapping(method = RequestMethod.GET)
public String index(WebRequest request) {
return "index";
}
示例11: configuratie
/**
* Geef de configuratie gegevens.
* @return configuratie gegevens
*/
@RequestMapping(method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public Map<String, String> configuratie() {
return configuratie;
}
示例12: findAll
@RequestMapping(value = "list", method = RequestMethod.GET)
public ResponseEntity<List<OrderDto>> findAll();
示例13: getRanking
@RequestMapping(method = RequestMethod.GET, path = "/rank/{topic}")
public List<RankedAuthor> getRanking(@PathParam("topic") String topic) {
return rankingService.getRanking(topic);
}
示例14: getStories
@CrossOrigin
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "Find all stories", notes = "Returns a collection of stories")
public List<StoryDTO> getStories() {
return storyService.findStories();
}
示例15: register
@RequestMapping(value = "register", method = RequestMethod.GET)
public String register() {
return "register.ftl";
}