I just copy the example on the primetime showcase, but the area that selects the image is not showing up. It looks a lot easier in Showcase
My page:
& lt; Ui: Composition xmlns = "http://www.w3.org/1999/xhtml" xmlns: ui = "http: / / java.sun.com/jsf/facelets" xmlns: f = "http: // java. Sun.com/jsf/core "xmlns: h =" http://java.sun.com/jsf/html "xmlns: p =" http://primefaces.org/ui "& gt; & Lt; H: form & gt; & Lt; P: image carrier value = "# {uploadmb.croppedImage}" id = "imageCropper" image = "/ images / banner.jpg" /> & Lt; / H: form & gt; & Lt; / Ui: Composition & gt; My previous back:
@ managed class public MDP upload MRI serializable {Private Static Finals Logger Logger = Logger. Tags (upload MB.class.getName ()); Private cropped image crop image; Private string newImageName; Public String Crop (if (Crop Image == empty) returnNull; setNewImageName (getRandomImageName ()); AllContentContentContentContact = (AllContact) FacesContext.getCurrentInstance (). GetExternalContext (). GetContext (); String newFileName = servletContext.getRealPath ("") + File Separator + "Images" + File Separator + "Barka" + File Separator + Matching NIJJname () + ".jpg"; File Image Output Stream Image Output; Try {imageOutput = New FileImageOutputStream (New File (newFileName); ImageOutput.write (croppedImage.getBytes (), 0, cropp EdImage.getBytes () Length;) imageOutput.close ();} Hold (FileNotFoundException e) {e.printStackTrace ();} Hold (IOException e) {e.printStackTrace ();} Return Null;} Private string getRandomImageName ( } {Int i = (int) (Math.random (* * 100000); Return String.valueOf (i);} Public string getNewImageName () {newImageName;} Cropred image to public croped image () {Return crop image;} Public Zero Set CropRad Image (CropImage Cropped Image) {this.croppedImage = croppedImage; } Public void setNewImageName (string newImageName) {this.newImageName = newImageName; } Is it possible that some libraries are missing? Or another configuration option? I just downloaded the primetime 3.5 jar and put it in my square path.
Thanks
Does your image be on% WEBAPP_ROOT% / images / banner.jpg
Can you access your image via the HTTP URL (Browser)?
No comments:
Post a Comment