Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Server Status Codes  RSS feed

 
michael markey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to READ the server status codes for a given response object. For example, if I use a request dispatcher to send a visitor off to another page, then once the dispatch is done, I'd like to determine the status code (404, 200, 301, etc.). Is there any way to do this. I saw that in some custom libraries there are classes that give this info, but I am limited to the standard Java classes from Sun. Any ideas? I see how to SET the code with the HttpServletResponse object, but I want to READ the code. Thanks for any help.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might not be exactly what you are looking for, but have a look at java.net.HttpURLConnection, getResponseCode() in particular.
Dave.
 
michael markey
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah. I forgot about that class. I don't want to have to use that class, but hopefully it can steer me in the right direction. Thanks for the info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!