留言板
Resources loading issue (images)
Johann Kneringer,修改在12 年前。
Resources loading issue (images)
Junior Member 帖子: 42 加入日期: 11-11-10 最近的帖子
Hi,
I've developed some jsf2 portlets using portletfacesbridge 2.0 & in some cases icefaces. (Liferay 6.1, sdk 6.1,portletfaces-bridge-2.0.0., latest icefaces & mojarra)
I've developed it using ubuntu & the liferay IDE.
On Ubuntu, everything works fine.
But in some cases, while using a Windows Operating System in combination with Firefox/Internet Explorer, the images of the portlets are not getting loaded. When pushing reloading the page (pushing F5) the images appear.
Seems to me, like there is a resource loading issue.
Are there any know issues regarding this resource loading problem?
Is there a part in the web.xml where I can solve this issue?
Here is my web.xml
<?xml version="1.0"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.icefaces.uniqueResourceURLs</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- Many of the ICEfaces Components make use of the Resource Servlet -->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- The standard mapping. Can use other extensions, or path mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- These specific mappings are necessary for the Resource Servlet to function properly -->
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/icefaces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Thanks,
greets from Austria,
Johann
I've developed some jsf2 portlets using portletfacesbridge 2.0 & in some cases icefaces. (Liferay 6.1, sdk 6.1,portletfaces-bridge-2.0.0., latest icefaces & mojarra)
I've developed it using ubuntu & the liferay IDE.
On Ubuntu, everything works fine.
But in some cases, while using a Windows Operating System in combination with Firefox/Internet Explorer, the images of the portlets are not getting loaded. When pushing reloading the page (pushing F5) the images appear.
Seems to me, like there is a resource loading issue.
Are there any know issues regarding this resource loading problem?
Is there a part in the web.xml where I can solve this issue?
Here is my web.xml
<?xml version="1.0"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.icefaces.uniqueResourceURLs</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- Many of the ICEfaces Components make use of the Resource Servlet -->
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- The standard mapping. Can use other extensions, or path mappings -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- These specific mappings are necessary for the Resource Servlet to function properly -->
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/icefaces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Thanks,
greets from Austria,
Johann
Neil Griffin,修改在12 年前。
RE: Resources loading issue (images)
Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
Here are some comments from https://github.com/liferay/liferay-faces/blob/master/bridge-impl/src/main/java/com/liferay/faces/bridge/container/liferay/PortletContainerLiferayImpl.java
// Note that Liferay didn't support the Portlet 2.0 ResourceResponse.HTTP_STATUS_CODE feature until Liferay
// 6.0.6 CE and 6.0.11 EE. See: http://issues.liferay.com/browse/LPS-9145
// Also note that Liferay 6.0 EE version numbering begins with 6.0.10 (6010).
So it might be that Liferay 6.1 doesn't have this ability?
Try adding the following to your web.xml:
<context-param>
<param-name>org.portletfaces.bridge.containerAbleToSetHttpStatusCode</param-name>
<param-value>false</param-value>
</context-param>
And let me know if that fixes things.
// Note that Liferay didn't support the Portlet 2.0 ResourceResponse.HTTP_STATUS_CODE feature until Liferay
// 6.0.6 CE and 6.0.11 EE. See: http://issues.liferay.com/browse/LPS-9145
// Also note that Liferay 6.0 EE version numbering begins with 6.0.10 (6010).
So it might be that Liferay 6.1 doesn't have this ability?
Try adding the following to your web.xml:
<context-param>
<param-name>org.portletfaces.bridge.containerAbleToSetHttpStatusCode</param-name>
<param-value>false</param-value>
</context-param>
And let me know if that fixes things.
Johann Kneringer,修改在12 年前。
RE: Resources loading issue (images)
Junior Member 帖子: 42 加入日期: 11-11-10 最近的帖子
Hey Neil,
thanks for your answer...
I did not test your settings, because I've figured out, what the real problem is...
There is a problem with our virtual host...
If I open the webpage using the ip of the server, everything is loading fine...
When I open the webpage using the domain name, the images are not getting loaded on the first time and I do not get a session.
So there is a problem with the server configuration.
By the way: SSL on Port 8443 is configured and running.
I made some settings in the Liferay portal settings, where I added the domain name to the virtual host field in ->Settings -> Portal -> Settings - Virtual Host...
In the meantime im looking for some issues using tomcat with a virtual host an getting no session.
As I am a tomcat newbie I have no idea yet what this problem can cause.
Do I have to make manually changes in tomcat's server.xml regarding the domain name?
edit:
made some changes in server.xml:
<Host name="myhostname.mydomain.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
But nothing changes
thanks for your answer...
I did not test your settings, because I've figured out, what the real problem is...
There is a problem with our virtual host...
If I open the webpage using the ip of the server, everything is loading fine...
When I open the webpage using the domain name, the images are not getting loaded on the first time and I do not get a session.
So there is a problem with the server configuration.
By the way: SSL on Port 8443 is configured and running.
I made some settings in the Liferay portal settings, where I added the domain name to the virtual host field in ->Settings -> Portal -> Settings - Virtual Host...
In the meantime im looking for some issues using tomcat with a virtual host an getting no session.
As I am a tomcat newbie I have no idea yet what this problem can cause.
Do I have to make manually changes in tomcat's server.xml regarding the domain name?
edit:
made some changes in server.xml:
<Host name="myhostname.mydomain.com" appBase="webapps"
unpackWARs="true" autoDeploy="true">
But nothing changes
Johann Kneringer,修改在12 年前。
RE: Resources loading issue (images)
Junior Member 帖子: 42 加入日期: 11-11-10 最近的帖子
solved!
In liferay portal -> portal -> settings -> virtual host: there i've added myhostname.mydomain.com, my dns,...I've changed that to localhost, and now everything works perfect...Just a error in reasoning.
In liferay portal -> portal -> settings -> virtual host: there i've added myhostname.mydomain.com, my dns,...I've changed that to localhost, and now everything works perfect...Just a error in reasoning.