i have a page that contains image cropper element , i have configured prime faces on my project based on tutorials on web . it seems that everything is working fine .
but the main problem is in my back bean class.
Code: Select all
public class MyBean {
private CroppedImage croppedImage ;
.....
public CroppedImage getCroppedImage() {
return croppedImage;
}
public void setCroppedImage(CroppedImage croppedImage) {
this.croppedImage = croppedImage;
}
public String crop() {
if(croppedImage == null)
return null;
FileImageOutputStream imageOutput;
try {
imageOutput = new FileImageOutputStream(new File("croped.jpg"));
imageOutput.write(croppedImage.getBytes(), 0,
croppedImage.getBytes().length);
imageOutput.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
....
}
am i missing something ?
i am using primefaces 1.02 , richfaces 3 .