5 Replies Latest reply on Sep 9, 2009 5:39 AM by Nick Belaevski

    a4j:mediaOutput doesnt display the dynamic image

    jFoundation java Newbie

      Hi,

      I am using the mediaOutput sample code available on richfaces live demo site.

      It doesnt display the image on my page..it shows a broken URL.

      if i check the source of the generated html i can see a strange URL i am not able to make out anything out of it..may be its not resolving the URL..

      Am i missing some setting in my application,help needed urgently..


      URL of the borken Image:

      http://localhost:9080/bw-2tier-webapp-1.0.0/a4j/s/3_3_1.GAorg.ajax4jsf.resource.UserResource/n/s/-1487394660/DATA/eAFlks9rFDEUx18Hi1UUpCsFD0JZRUEkg9JKpRbFH2hh6oJjBRWE15m3u1kyk5hktsGiNxEUvHj1UOihF73oyX-h4KV!gyAiXkTwapItSmtuL3zz!X7ee3n3A8aNhjNS9xgO0M0MTJdpMrLRBbFlQ!rOTnFyWfPraBHCac1-T2BfBocLTWjpmqwt1dbCZDbAIaYC617aWRlQYecz2E9Oce!5GJ7BWAYTlSx5l1O5U48PUTQUC6c8y6lg4VgXCzKskJWStfdmufVBt6QoSec4JH1!6-PCm7eflxJIMjhQCDTmNla0myG3mtc9z3DQ-Ddl9LAwNaLkMs1JcxT8Ca4ImncqxJ!2kcw0dQQQZA0jwe5ib4lsX5Y3nPKdGC7rOAeAsUMATsOxEbSX7tV9SLdeffk98zqJutZf3T-njecv858Pti8FRSBox2UoLPoUsvcaLlZKvFi!!OnR5q9OCA-Tm1idgskTaxWVHK8S1kwhr-1TgEZD62Fsl4Wl-CnGgbzfvvf12!G1mzHSd5JYOBrIGJes01jVWC8krCwcidfx7WihSrnVObiQxizm-rYS01fOnT87d3F612dYaP!P0!YjVn8AVZbXmw__.jsf





        • 1. Re: a4j:mediaOutput doesnt display the dynamic image
          Nick Belaevski Master

          Hi,

          Any additional info about errors in server log or in Firebug net tab?

          • 2. Re: a4j:mediaOutput doesnt display the dynamic image
            jFoundation java Newbie

            There are no errors found in the server log...

            I am just sharing my web.xml ,just to check if something is not missing.

            Also the code used is exactly the same as on live demo ..

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
             <description>Richfaces Components demo</description>
             <display-name>richfaces-demo</display-name>
             <context-param>
             <param-name>facelets.RESOURCE_RESOLVER</param-name>
             <param-value>com.emirates.jfoundation.web.facelet.JarletResourceResolver</param-value>
             </context-param>
             <!--
            <context-param>
             <param-name>facelets.RESOURCE_RESOLVER</param-name>
             <param-value>com.sun.facelets.impl.DefaultResourceResolver</param-value>
            </context-param> -->
            <context-param>
             <param-name>facelets.LIBRARIES</param-name>
             <param-value>/WEB-INF/facelets/taglib/jw.taglib.xml</param-value>
            </context-param>
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.REFRESH_PERIOD</param-name>
             <param-value>2</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</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>com.sun.faces.validateXml</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>com.sun.faces.verifyObjects</param-name>
             <param-value>false</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.SKIN</param-name>
             <param-value>#{skinBean.skin}</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
             <param-value>NEKO, TIDY</param-value>
             </context-param>
             <context-param>
             <param-name>org.richfaces.CONTROL_SKINNING</param-name>
             <param-value>enable</param-value>
             </context-param>
             <context-param>
             <param-name>org.richfaces.LoadStyleStrategy</param-name>
             <param-value>DEFAULT</param-value>
             </context-param>
             <context-param>
             <param-name>org.richfaces.LoadScriptStrategy</param-name>
             <param-value>DEFAULT</param-value>
             </context-param>
             <context-param>
             <param-name>contextConfigLocation</param-name>
             <param-value>/WEB-INF/applicationContext.xml</param-value>
             </context-param>
             <!-- Needed As Part of Application Deployment -->
             <context-param>
             <param-name>app-config</param-name>
             <param-value>/WEB-INF/app-config.xml</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
             <param-value>true</param-value>
             </context-param>
             <filter>
             <filter-name>sessionTimeOutFilter</filter-name>
             <filter-class>com.emirates.jfoundation.web.core.filter.SessionTimeoutFilter</filter-class>
             <init-param>
             <param-name>com.emirates.jfoundation.web.core.filter.timeoutpage</param-name>
             <param-value>master/sessionExpiry.html</param-value>
             </init-param>
             </filter>
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             <init-param>
             <param-name>createTempFiles</param-name>
             <param-value>false</param-value>
             </init-param>
             <init-param>
             <param-name>maxRequestSize</param-name>
             <param-value>100000</param-value>
             </init-param>
             </filter>
             <!-- JFOUNDATION OFFSHORE CHANGES BEGIN -->
             <filter>
             <filter-name>gZipFilter</filter-name>
             <filter-class>com.emirates.jfoundation.web.core.filter.GZIPFilter</filter-class>
             <init-param>
             <param-name>exempted-patterns</param-name>
             <param-value>framework.pack.js.jsf,ui.pack.js.jsf,PrototypeScript.jsf,AjaxScript.jsf</param-value>
             </init-param>
             </filter>
             <!-- DISABLING THE GZIP FILTER, UN COMMENT THE FILTER-MAPPING TO RE-ENABLE IT -->
             <!-- <filter-mapping>
             <filter-name>gZipFilter</filter-name>
             <url-pattern>*.jsf</url-pattern>
             </filter-mapping> -->
             <!-- JFOUNDATION OFFSHORE CHANGES ENDS -->
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             <dispatcher>ERROR</dispatcher>
             </filter-mapping>
             <filter-mapping>
             <filter-name>sessionTimeOutFilter</filter-name>
             <url-pattern>*.jsf</url-pattern>
             </filter-mapping>
             <listener>
             <listener-class>com.emirates.jfoundation.web.servlet.BootStrap</listener-class>
             </listener>
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
             <servlet>
             <servlet-name>JasperServlet</servlet-name>
             <servlet-class>com.emirates.jfoundation.web.jasperreports.servlet.JasperServlet</servlet-class>
             </servlet>
             <servlet>
             <servlet-name>PdfServlet</servlet-name>
             <servlet-class>net.sf.jasperreports.j2ee.servlets.PdfServlet</servlet-class>
             </servlet>
             <servlet>
             <description>Lov Servlet</description>
             <display-name>LovServlet</display-name>
             <servlet-name>LovServlet</servlet-name>
             <servlet-class>com.emirates.jfoundation.web.lov.servlet.LovServlet</servlet-class>
             </servlet>
             <servlet-mapping>
             <servlet-name>PdfServlet</servlet-name>
             <url-pattern>/jasper/PDF</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>/reports/pagination</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>LovServlet</servlet-name>
             <url-pattern>/LovServlet</url-pattern>
             </servlet-mapping>
             <servlet-mapping>
             <servlet-name>JasperServlet</servlet-name>
             <url-pattern>/servlets/report/PDF</url-pattern>
             </servlet-mapping>
             <session-config>
             <session-timeout>30</session-timeout>
             </session-config>
             <welcome-file-list>
             <welcome-file>index.jsp</welcome-file>
             </welcome-file-list>
             <login-config>
             <auth-method>BASIC</auth-method>
             </login-config>
             <env-entry>
             <env-entry-name>ngcs/jdbc/DefaultRODS</env-entry-name>
             <env-entry-type>java.lang.String</env-entry-type>
             <env-entry-value>OracleRODS</env-entry-value>
             </env-entry>
             <env-entry>
             <env-entry-name>ngcs/jdbc/DefaultRWDS</env-entry-name>
             <env-entry-type>java.lang.String</env-entry-type>
             <env-entry-value>OracleRWDS</env-entry-value>
             </env-entry>
             <resource-ref>
             <description>Read only DB Connection</description>
             <res-ref-name>OracleRODS</res-ref-name>
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
             </resource-ref>
             <resource-ref>
             <description>Read/Write DB Connection</description>
             <res-ref-name>OracleRWDS</res-ref-name>
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
             </resource-ref>
            </web-app>
            


            [/img]

            • 3. Re: a4j:mediaOutput doesnt display the dynamic image
              Nick Belaevski Master

              Try downloading generated file and checking its contents.

              • 4. Re: a4j:mediaOutput doesnt display the dynamic image
                jFoundation java Newbie

                Got it working...

                It was a configuration mistake...

                i just used the sample code from the live demo and used it as is..

                i had'nt configured the MediaData object as a Managed bean in my faces-config file..

                It would be a great help if the documentation is updated to let users know the things that need to be configured to get the sample working...

                thanks for your help..

                • 5. Re: a4j:mediaOutput doesnt display the dynamic image
                  Nick Belaevski Master

                  You can checkout richfaces-demo source code from SVN.