• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jersey Response issue driving me batty!

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic