• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Jersey Response issue driving me batty!

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using jersey 1.8 from the jersey bundle and running on glassfish 3.1. I'm writing a REST web service and all has been peachy, until I need to send a specific response code. Every time I try to get a ResponseBuilder object I get a very generic jersey exception. Here's my code:



The method errors out on line 20. Note I know that this code doesn't do anything useful. I'm attempting to return a 403 response with a custom header. In my testing I deliberately call the method with parameters that will cause a ForbiddenException (a custom exception) to be thrown. Here is the error I see when I attempt to execute line 20 above:


Prior to this the method's return type was JSONObject and I wasn't attempting to modify the response in any way and life was hunky-dory. Does anyone have any ideas what I could do to make this work? I've been at it for hours.


Regards,

Manny
 
Manny Garcia
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I found something that worked. I did not find any documentation that said to do it this way, but it has the virtue of working:




Regards,

Manny
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!