掲示板

Liferay Primefaces galleria images not showing

9年前 に Jay Millan によって更新されました。

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

<!--?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 &lt;= 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.
thumbnail
9年前 に Neil Griffin によって更新されました。

RE: Liferay Primefaces galleria images not showing

Liferay Legend 投稿: 2655 参加年月日: 05/07/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
9年前 に Yurg Block によって更新されました。

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
thumbnail
9年前 に Vernon Singleton によって更新されました。

RE: Liferay Primefaces galleria images not showing

Expert 投稿: 315 参加年月日: 13/01/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.
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
9年前 に Yurg Block によって更新されました。

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!
thumbnail
9年前 に Vernon Singleton によって更新されました。

RE: Liferay Primefaces galleria images not showing

Expert 投稿: 315 参加年月日: 13/01/14 最新の投稿
Glad to hear that it is working for you.