Showing posts with label httprequest. Show all posts
Showing posts with label httprequest. Show all posts

Wednesday, May 23, 2012

Request Monitoring in Chrome


In Firefox, I use Firebug which allows me to view every http request my ajax calls are making. I've switched over my development to Chrome and am liking it so far. My only complaint, however, is that the developer tools don't seem to allow you to view each ajax request. I've had it happen once where the Resources panel showed multiple requests to the same resource, but it's only done it once and never again.

Friday, April 27, 2012

Android: How get the status-code of an HttpClient request


I want to download a file and need to check the response status code (ie HTTP /1.1 200 OK ). This is a snipped of my code:

Friday, February 24, 2012

Render images by java code or read images from a static path?


Here's my code:



1.Java Code:




public static void getImg(Long itemId) {
try {
Item item = Item.findById(itemId);
if (item.img != null && item.img.getFile() != null{
response.setContentTypeIfNotSet(item.img.type());
renderBinary(item.img.get());
}
} catch (Exception e) {
Logger.error("Can't find image,itemId = " + itemId);
}
}

html : < img src="@{{ Items.getImage(123)}}"/>