In jsf , if we want to crop image on mmouse release. then use following code.

<h:commandLink action="#{cropAction.crop}" onclick="return false;" onmouseup="return true;">
<h:graphicImage value="#{cropAction.image}" />

As on click of commandLink the form has been submitting , setting onclick return false , so form won't submit. Then afer selecting the area when we release the mouse ,setting return true, so now form get submitted and we get the coordinate and we can crop the image.