graphicimage

How to reference an img in p:graphicImage from the resource folder [duplicate]

喜夏-厌秋 提交于 2020-01-24 12:17:21
问题 This question already has answers here : How to reference CSS / JS / image resource in Facelets template? (4 answers) Closed 3 years ago . I have an image in the following path: resources \_____img \_______sites \_______reddit.png I used this command line to reference it: <p:graphicImage library="img" name="/sites/reddit.png"/> but in the development console it says: GET http://localhost:8080/RES_NOT_FOUND 404 () and the image is not rendered. What's wrong? 回答1: Kukeltje's suggested url (What

How to make p:graphicImage clickable and invoke bean action

浪尽此生 提交于 2019-12-29 08:48:07
问题 I am using <p:graphicImage> like below: <div id="mapp"> <h3>Country Map</h3> <p:graphicImage id="city" value="#{countryPages_Setup.countryMap}" width="250" height="190"> </p:graphicImage> </div> But this is not a clickable image. How can I make this image clickable so when user click on it, I can invoke the managed bean action that I want. 回答1: Wrap your image in a h:commandLink / h:link : <h:commandLink action="..."> <p:graphicImage id="city" value="#{countryPages_Setup.countryMap}" width=

Passing argument to actionListener method with p:commandLink inside c:forEach loop

喜你入骨 提交于 2019-12-25 08:33:04
问题 I have a dialog that contains a list of graphic images inside command links. When a command link is clicked, I want to pass the image name as action listener method argument. Dialog's code: <p:dialog id="idSchemaDlg5" widgetVar="schemaDlg" styleClass="maxSizeDialog" position="90,250" style="max-width:1000px;max-height: 1000px;" header="Schéma des circuits"> <c:forEach id="schemaDataGrid" items="#{historyGenerationBean.schemaList}" var="fileCircuits" varStatus="schemaNum"> <h:panelGrid columns

WARNING: JSF1091: No mime type could be found for file dynamiccontent

不羁岁月 提交于 2019-12-21 01:05:31
问题 I get the following warning under eclipse : WARNING: JSF1091: No mime type could be found for file dynamiccontent. To resolve this, add a mime-type mapping to the applications web.xml This error is caused when I post a picture below primefaces composant : <p:graphicImage value="#{bean.image}"/> Java Bean : private StreamedContent image; // Getter public StreamedContent getImage() { try { JFreeChart jfreechart = ChartFactory.createPieChart3D("", createDataset(), true, true, false); PiePlot3D

Display database blob images in <p:graphicImage> inside <ui:repeat>

北城以北 提交于 2019-12-17 02:22:22
问题 I'm using PrimeFaces 3.2 on JBoss 7.1.1. I am trying to display an image which is stored in a BLOB in a MySQL database in <ui:repeat> . The image is stored in a byte[] and then converted to a StreamedContent as follows: InputStream stream = new ByteArrayInputStream(ingredient.getImage()); ingredient.setJsfImage(new DefaultStreamedContent(stream, "image/jpg")); Then I am trying to display it in a Facelet as follows: <ui:repeat var="ingredient" value="#{formBean.ingredientResultSet}"> <p:panel

When I use o:graphicImage, the image is not displayed

坚强是说给别人听的谎言 提交于 2019-12-13 07:08:17
问题 I can´t display images from my database, they are stored as bytea and I am mapping them like this: @Entity @Table(name = "photograph", schema = "public") public class Photograph{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "photograph_id", unique = true, nullable = false) private Long id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "diagnostic_id", nullable = false, insertable = false, updatable = false) private Diagnostic diagnostic; @Column(name =

Is there news on getting the URL of <p:graphicImage>?

一曲冷凌霜 提交于 2019-12-13 03:21:52
问题 Basically my question is the same as this one answered five years ago: I would like to output the URL of a server-provided image as from <p:graphicImage> , but just the URL and not an <img> tag. What I am looking for is a solution like this: (This is not working code, just to illustrate:) <p:graphicImage var="url" value="#{MyForm.image}"/> <span id="imageData" data-image="#{url}/> Which should output to the HTML like this: <span id="imageData" data-image="http://localhost:8080/contextPath

primefaces 4.0 p:graphicImage firefox bug

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 18:34:07
问题 Here is my problem with firefox using primefaces 4.0 communication version: p:graphicImage I have a list of model, whenever I click 1 item, I would like to get 1 image respectively In xhtml file <p:fieldset id="modelDiagramView" style="width:100%;height:1280px"> <p:panel id="panel"> <p:graphicImage value="#{modelBean.modelImage}" style="width: 100%;" cache="false"/> </p:panel> </p:fieldset> in java bean, only session scope and application scope are running well public StreamedContent

h:graphicImage not reRender

故事扮演 提交于 2019-12-11 23:17:55
问题 i have a jsf file where i have selectOneMenu and a h:graphicImage.Now the problem is when i send onchange request through selectOneMenu and want to reRender the h:graphicImage and want to show and hide boolean in action bean.But not work properly. Actully first i investigate it very carefully that when i send action through selectOneMenu the boolean value set correctly in bean but not set the reRender value properly.If i refresh page then it work properly.Anyone who i can solve it if i want

Stream closed Exception

青春壹個敷衍的年華 提交于 2019-12-11 14:23:59
问题 I'm getting Stream is closed Exception when I'm going to save the uploaded image. I'm tring to preview graphicImage of uploaded image the before save. This operation is working. But I can't save the image. Here is my code: private InputStream in; private StreamedContent filePreview; // getters and setters public void upload(FileUploadEvent event)throws IOException { // Folder Creation for upload and Download File folderForUpload = new File(destination);//for Windows folderForUpload.mkdir();