• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on annotations

 
jigar singh
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am using Apache cxf annotation @CrossOriginResourceSharing on my JAX-RS resource to restrict my service to be accessed only by authentic machines.

@CrossOriginResourceSharing (allowOrigins = {"http://test.caderanch.com:7001",allowCredentials = true)
@Path("/test")
public class TestRestImpl{
...
}


My question is that this same class file will be moved to Dev. INT, UAT and Prod environments. And for every environment I have different values("URLs") to be passed to this annotation @CrossOriginResourceSharing.

Is there any way to enable passing different value to this annotation during build or deployment or any other means.

Any help will be greatly appreciated.

Thanks
Kanwaljit
 
S Poon
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jigar singh,

@CrossOriginResourceSharing is just another filter for you servlet which you can configure in your web.xml
With Maven and Hudson, you can automate this configuration & deploy process for your DEV, INT, UAT and Prod.

Check this link out, and you find your answer for the web.xml configuration:

http://docs.safe.com/fme/2013sp1/html/FME_Server_Documentation/Default.htm#Configuring_CORS_Filtering.htm

Good luck,

Steven
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic