jsf2.0和primefaces中裁剪后的图像上载
我想上传裁剪后的图像。我这样做:,首先上传图片并在页面内显示。但问题是,当我裁剪图像并单击submit按钮时,不会调用相应的图像裁剪器bean。我不知道我错在哪里 xhtml代码:jsf2.0和primefaces中裁剪后的图像上载,jsf,jsf-2,primefaces,Jsf,Jsf 2,Primefaces,我想上传裁剪后的图像。我这样做:,首先上传图片并在页面内显示。但问题是,当我裁剪图像并单击submit按钮时,不会调用相应的图像裁剪器bean。我不知道我错在哪里 xhtml代码: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/j
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
<script src="jquery-1.4.2.js"></script>
<script src="jquery.Jcrop.js"></script>
<script src="jquery.min.js"></script>
<script src="jquery.Jcrop.min.js"></script>
</h:head>
<h:body>
<h:form >
<p:panel header="FILE UPLOAD WITH CROPPER" style="width:900px; margin: 0 auto; margin-top:0px">
<p:fileUpload fileUploadListener="#{photoUploadAction.handleImageUpload}"
mode="advanced"
update="getImageId,messages" auto="true"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
<p:growl id="messages" showDetail="true"/>
<p:growl id="uploadMessages" showSummary="true" showDetail="true"/>
<p:outputPanel id="getImageId">
<h:panelGrid columns="2">
<p:imageCropper id="cropperId" value="#{imageCrop.croppedImage}"
image="images/#{photoUploadVO.imageName}"/>
<p:graphicImage value="cropImages/#{imageCrop.imageName}" cache="false"/>
</h:panelGrid>
<p:commandLink value="Crop" update="getImageId" action="#{imageCrop.crop}" type="submit" />
</p:outputPanel>
</p:panel>
</h:form>
</h:body>
</html>
我无法正确理解您的问题,据我所知,我认为您可能没有在
faces.config
中为您的imageCropperBean创建managedBean
。或者只需在cropperBean类@managedBean