Skip to main content

Posts

Showing posts with the label httprequest

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.

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)}}"/> 2. html : < img src="/public/images/123.jpg"/> I'm using playframework and the samples from documentation display images via the first version. What's the different (deep into mechanism) between them, especially in response performance ?