当前位置: 首页>>代码示例>>Java>>正文


Java RequestMethod.GET属性代码示例

本文整理汇总了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);
  }
}
 
开发者ID:edgexfoundry,项目名称:core-data,代码行数:29,代码来源:ValueDescriptorControllerImpl.java

示例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";
}
 
开发者ID:ica10888,项目名称:trpgrun,代码行数:12,代码来源:BookController.java

示例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;
}
 
开发者ID:hzwy23,项目名称:hauth-java,代码行数:12,代码来源:SystemPageController.java

示例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";
}
 
开发者ID:Exercon,项目名称:AntiSocial-Platform,代码行数:13,代码来源:CategoryController.java

示例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);
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:9,代码来源:ReleaseController.java

示例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";	
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:8,代码来源:DepartmentController.java

示例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";
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:11,代码来源:PlaylistsController.java

示例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);

}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:9,代码来源:NamespaceController.java

示例9: stop

@RequestMapping(value = "spider/stop.do", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ResultBundle<String> stop(String uuid) {
	return service.stop(uuid);
}
 
开发者ID:TransientBuckwheat,项目名称:nest-spider,代码行数:5,代码来源:CommonSpiderController.java

示例10: index

@RequestMapping(method = RequestMethod.GET)
public String index(WebRequest request) {
    return "index";
}
 
开发者ID:Cinderpup,项目名称:RoboInsta,代码行数:4,代码来源:IndexController.java

示例11: configuratie

/**
 * Geef de configuratie gegevens.
 * @return configuratie gegevens
 */
@RequestMapping(method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
public Map<String, String> configuratie() {
    return configuratie;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:9,代码来源:ConfiguratieController.java

示例12: findAll

@RequestMapping(value = "list", method = RequestMethod.GET)
public ResponseEntity<List<OrderDto>> findAll();
 
开发者ID:Rustam-Kadyrov,项目名称:microservices-spring,代码行数:2,代码来源:OrderResource.java

示例13: getRanking

@RequestMapping(method = RequestMethod.GET, path = "/rank/{topic}")
public List<RankedAuthor> getRanking(@PathParam("topic") String topic) {
    return rankingService.getRanking(topic);
}
 
开发者ID:Activiti,项目名称:activiti-cloud-examples,代码行数:4,代码来源:RankingController.java

示例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();
}
 
开发者ID:Code4SocialGood,项目名称:c4sg-services,代码行数:6,代码来源:StoryController.java

示例15: register

@RequestMapping(value = "register", method = RequestMethod.GET)
public String register() {
	return "register.ftl";
}
 
开发者ID:MarchMachao,项目名称:ZHFS-WEB,代码行数:4,代码来源:UserController.java


注:本文中的org.springframework.web.bind.annotation.RequestMethod.GET属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。