zoukankan      html  css  js  c++  java
  • JAX-RS annotations

    @Path("resource_path"):
    The @Path annotation defines the path to the base URL or resource_path. The base URL is based on the application's name, the servlet, and the URL pattern from the web.xml configuration file.

    @PathParam:
    The @PathParam annotation is used to inject values from the URL into a method parameter. In this way, one can inject, say, the ID of a resource into the method for getting the correct object.

    @GET:
    The @GET annotation indicates that the method will answer to an HTTP GET request.

    @PUT:
    The @PUT annotation indicates that the method will answer to an HTTP PUT request.

    @POST:
    The @POST annotation indicates that the method will answer to an HTTP POST request.

    @DELETE:
    The @DELETE annotation indicates that the method will answer to an HTTP DELETE request.

    @Produces(MediaType.TEXT_PLAIN):
    The @Produces annotation defines which MIME type is delivered by a method annotated with any HTTP annotated methods. In the given example, a text (text/plain) is produced. Other examples would be application/xml or application/json.

    @Consumes(type):
    The @Consumes annotation defines which MIME type is consumed by this method.

  • 相关阅读:
    测试随笔
    ECNU 3530 和你在一起
    ECNU 1030 母牛生小牛
    ECNU 3081 购房还款
    PPP模式下的融资结构优化
    决策树分类
    关联规则-R语言实现
    中国快递包裹总量的预测-基于SARIMA模型
    LeetCode 2 :Swap Nodes in Pairs
    2018092609-2 选题 Scrum立会报告+燃尽图 04
  • 原文地址:https://www.cnblogs.com/IcanFixIt/p/5117093.html
Copyright © 2011-2022 走看看