留言板
Liferay Primefaces galleria images not showing
Jay Millan,修改在9 年前。
Liferay Primefaces galleria images not showing
New Member 帖子: 3 加入日期: 14-12-12 最近的帖子
Hi,
Im currently studying liferay with primefaces. Im testing the galleria component from the tutorial and I am getting this error for each image.
Resource handler=[com.liferay.faces.bridge.application.ResourceHandlerOuterImpl@1c5b6d] was unable to create a resource for resourceName=[/views/demo/images/nature/test4.jpg] libraryName=[null] contentType=[null]
view.xhtml
ImagesView.java
Attached are my eclipse project content and the result screen.
Thanks.
Im currently studying liferay with primefaces. Im testing the galleria component from the tutorial and I am getting this error for each image.
Resource handler=[com.liferay.faces.bridge.application.ResourceHandlerOuterImpl@1c5b6d] was unable to create a resource for resourceName=[/views/demo/images/nature/test4.jpg] libraryName=[null] contentType=[null]
view.xhtml
<!--?xml version="1.0"?-->
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<h:body>
<h:outputtext value="Gallery" />
<h:graphicimage value="/views/demo/images/nature/test3.jpg" />
<p:galleria value="#{imagesView.images}" var="image" panelwidth="300" panelheight="200" showcaption="true">
<p:graphicimage name="/views/demo/images/nature/#{image}" alt="Image Description for #{image}" title="#{image}" />
</p:galleria>
</h:body>
</f:view>
ImagesView.java
package com.jpportlets.managedbeans;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
@ManagedBean
@ViewScoped
public class ImagesView implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<string> images;
@PostConstruct
public void init() {
FacesContext.getCurrentInstance().getExternalContext().getSession(true);
images = new ArrayList<string>();
for (int i = 1; i <= 4; i++) {
images.add("test" + i + ".jpg");
}
}
public List<string> getImages() {
return images;
}
}</string></string></string>
Attached are my eclipse project content and the result screen.
Thanks.
Neil Griffin,修改在9 年前。
RE: Liferay Primefaces galleria images not showing
Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
Hi Yurg,
When you get a chance, please let us know the URL that you see for the missing image. You can do this by hovering your mouse over the missing image in the browser, and then right click to get a context menu to see if it will let you copy the URL.
Kind Regards,
Neil
When you get a chance, please let us know the URL that you see for the missing image. You can do this by hovering your mouse over the missing image in the browser, and then right click to get a context menu to see if it will let you copy the URL.
Kind Regards,
Neil
Yurg Block,修改在9 年前。
RE: Liferay Primefaces galleria images not showing
New Member 帖子: 3 加入日期: 14-12-12 最近的帖子Neil Griffin:
Hi Yurg,
When you get a chance, please let us know the URL that you see for the missing image. You can do this by hovering your mouse over the missing image in the browser, and then right click to get a context menu to see if it will let you copy the URL.
Kind Regards,
Neil
Hi Neil,
all images have this URL
http://localhost:8080/web/guest/RES_NOT_FOUND
Vernon Singleton,修改在9 年前。
RE: Liferay Primefaces galleria images not showing
Expert 帖子: 315 加入日期: 13-1-14 最近的帖子
Hello Yurg,
I was able to reproduce your error when I use the "name" attribute in the p:graphicImage tag as you have shown us.
Try using the "value" attribute of the p:graphicImage tag. (I'm pretty sure that the "name" attribute must always be used with the "library" attribute, but your resources are not stores in a "resources" directory, so JSF will not be able to find them using the "name" attribute).
Hope that helps,
Vernon
I was able to reproduce your error when I use the "name" attribute in the p:graphicImage tag as you have shown us.
Yurg Block:
<p:galleria value="#{imagesView.images}" var="image" panelwidth="300" panelheight="200" showcaption="true"> <p:graphicimage name="/views/demo/images/nature/#{image}" alt="Image Description for #{image}" title="#{image}" /> </p:galleria>
Try using the "value" attribute of the p:graphicImage tag. (I'm pretty sure that the "name" attribute must always be used with the "library" attribute, but your resources are not stores in a "resources" directory, so JSF will not be able to find them using the "name" attribute).
Hope that helps,
Vernon
Yurg Block,修改在9 年前。
RE: Liferay Primefaces galleria images not showing
New Member 帖子: 3 加入日期: 14-12-12 最近的帖子Vernon Singleton:
Hello Yurg,
I was able to reproduce your error when I use the "name" attribute in the p:graphicImage tag as you have shown us.Yurg Block:<p:galleria value="#{imagesView.images}" var="image" panelwidth="300" panelheight="200" showcaption="true"> <p:graphicimage name="/views/demo/images/nature/#{image}" alt="Image Description for #{image}" title="#{image}" /> </p:galleria>
Try using the "value" attribute of the p:graphicImage tag. (I'm pretty sure that the "name" attribute must always be used with the "library" attribute, but your resources are not stores in a "resources" directory, so JSF will not be able to find them using the "name" attribute).
Hope that helps,
Vernon
Hi Vernon,
Thank you very much, it solved the problem.
Cheers mate!
Vernon Singleton,修改在9 年前。
RE: Liferay Primefaces galleria images not showing
Expert 帖子: 315 加入日期: 13-1-14 最近的帖子
Glad to hear that it is working for you.