12 Replies Latest reply on Dec 1, 2008 9:28 PM by arissonleal

    a:mediaOutput don't display the image.

    arissonleal

      Hi,

      I'm using the <a:mediaOutput> and it just display images with small size like 3,40 KB if is greater than this don't display.

      My method paint:

      public synchronized void paint(OutputStream out, Object data)
       throws IOException {
       out.write(((LayoutData) data).getData());
      }
      


      my web.xml
      <filter>
       <filter-name>Seam Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamFilter</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>200000</param-value>
       </init-param>
       </filter>
      


      what could be the problem ?

        • 1. Re: a:mediaOutput don't display the image.
          nbelaevski

          Try to do out.flush().
          What is your application server?

          • 2. Re: a:mediaOutput don't display the image.
            arissonleal

            Don't work.

            My Application server is jboss-4.2.3.GA.

            • 3. Re: a:mediaOutput don't display the image.
              arissonleal

              I try with examples from richfaces live demo and works fine with a jsf project, but with seam project the same code don't work.

              I need configure anything else, for this component work with seam ?

              • 4. Re: a:mediaOutput don't display the image.
                ilya_shaikovsky

                we already have internal example with seam on this.. And its works... please show the web.xml for your seam project..

                • 5. Re: a:mediaOutput don't display the image.
                  arissonleal

                  my web.xml

                  <?xml version="1.0" ?>
                  <web-app 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"
                  version="2.5">
                  
                   <context-param>
                   <param-name>org.ajax4jsf.SKIN</param-name>
                   <param-value>#{skinBean.skin}</param-value>
                   </context-param>
                  
                   <!-- Suppress spurious stylesheets -->
                  
                   <context-param>
                   <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                   <param-value>enable</param-value>
                   </context-param>
                  
                  
                   <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
                  
                   <context-param>
                   <param-name>org.richfaces.LoadStyleStrategy</param-name>
                   <param-value>ALL</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>org.richfaces.LoadScriptStrategy</param-name>
                   <param-value>ALL</param-value>
                   </context-param>
                  
                   <!-- Seam -->
                  
                   <listener>
                   <listener-class>
                   org.jboss.seam.servlet.SeamListener
                   </listener-class>
                   </listener>
                  
                   <filter>
                   <filter-name>Seam Filter</filter-name>
                   <filter-class>org.jboss.seam.servlet.SeamFilter</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>200000</param-value>
                   </init-param>
                  
                   </filter>
                  
                   <filter-mapping>
                   <filter-name>Seam Filter</filter-name>
                   <url-pattern>*.seam</url-pattern>
                  
                   </filter-mapping>
                   <servlet>
                   <servlet-name>Connector</servlet-name>
                   <servlet-class>
                   net.fckeditor.connector.ConnectorServlet
                   </servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                  
                   <servlet-mapping>
                   <servlet-name>Connector</servlet-name>
                   <url-pattern>
                   /fckeditor/editor/filemanager/connectors/sef/*
                   </url-pattern>
                   </servlet-mapping>
                  
                   <servlet>
                   <servlet-name>Seam Resource Servlet</servlet-name>
                   <servlet-class>
                   org.jboss.seam.servlet.SeamResourceServlet
                   </servlet-class>
                   </servlet>
                  
                   <servlet-mapping>
                   <servlet-name>Seam Resource Servlet</servlet-name>
                   <url-pattern>/seam/resource/*</url-pattern>
                   </servlet-mapping>
                  
                   <!-- Facelets development mode (disable in production) -->
                  
                   <context-param>
                   <param-name>facelets.DEVELOPMENT</param-name>
                   <param-value>true</param-value>
                   </context-param>
                  
                   <context-param>
                   <param-name>facelets.LIBRARIES</param-name>
                   <param-value>/WEB-INF/facelets/a3mTags.xml</param-value>
                   </context-param>
                   <!-- JSF -->
                  
                   <context-param>
                   <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                   <param-value>.xhtml</param-value>
                   </context-param>
                  
                   <servlet>
                   <servlet-name>Faces Servlet</servlet-name>
                   <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                   <load-on-startup>1</load-on-startup>
                   </servlet>
                  
                   <servlet-mapping>
                   <servlet-name>Faces Servlet</servlet-name>
                   <url-pattern>*.seam</url-pattern>
                   </servlet-mapping>
                  
                   <security-constraint>
                   <display-name>Restrict raw XHTML Documents</display-name>
                   <web-resource-collection>
                   <web-resource-name>XHTML</web-resource-name>
                   <url-pattern>*.xhtml</url-pattern>
                   </web-resource-collection>
                   <auth-constraint />
                   </security-constraint>
                  
                  
                  </web-app>
                  


                  • 6. Re: a:mediaOutput don't display the image.
                    ilya_shaikovsky

                    We've checked the settings and our test ones are the same..

                     <init-param>
                     <param-name>maxRequestSize</param-name>
                     <param-value>200000</param-value>
                     </init-param>
                    


                    this value are in bytes.. So the max size is about 200kb.. Maybe you trying largest ones?

                    • 7. Re: a:mediaOutput don't display the image.
                      arissonleal


                      I put this and try with a image 7KB and don't work, but with a image with 5KB work.

                      <param-value>2000000</param-value>


                      any clue ?


                      • 8. Re: a:mediaOutput don't display the image.
                        nbelaevski

                        Are there are any errors for image resource in Firebug "Net" tab?

                        • 9. Re: a:mediaOutput don't display the image.
                          arissonleal

                          No errors.

                          • 10. Re: a:mediaOutput don't display the image.
                            arissonleal

                            I've put conversation @Scope(ScopeType.SESSION) and works.

                            Could be a problem with seam filter ?

                            • 11. Re: a:mediaOutput don't display the image.
                              nbelaevski

                              Maybe. Can you please post a small project somewhere for investigation?

                              • 12. Re: a:mediaOutput don't display the image.
                                arissonleal

                                Here is the link with the project:
                                https://svn.no-ip.info/down/test.zip

                                jboss-seam-2.1.0.SP1
                                jboss-4.2.3.GA

                                The media output just work with session scope.

                                tks