Search code examples
javaweb-servicesjax-rsjax-ws

How to set javax.ws.rs.Path annotation value from properties


I want to set javax.ws.rs.Path annotation value from properties file. The purpose is not to make it configurable, rather the purpose is to separate the value from code.

The following code works:

private final String path="my_path";

@GET
@Path(path)
@Produces(MediaType.TEXT_XML)
public String wsdlRequest(@Context UriInfo uriInfo)
{
    ....
     ...
    ..
}

But the following does not:

private final String path=bundle.getString("PATH");

Solution

  • I guess one cannot, since the value isn't available in the compile time.