使用 spring 和 jersy 构建的其余应用程序。
我需要一个可以从属性文件中读取 @path 注释的值的 REST 应用程序。
PFB 代码示例:-
@Controller
@Path("report")
public class CommonService extends BaseService
{
@Path("specificGet")
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getReport ()
{
-----------
-----------
}
我希望可以从 .properties 文件中读取现在为“specicGet”的值。 例如,如果我在属性文件中有以下条目:-
path.getwithoutparam=thispathforGet
我想引用这个属性来进行@path注释 请提出意见/建议将会非常有帮助。
最佳答案
我可能会得到一些反对票:)),但我很确定@Path 注释的属性占位符没有开箱即用的支持。
我想在这种情况下你必须构建自己的注释处理器,插入 Spring 属性处理系统。
关于java - 从属性文件中读取@Path,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23564835/