1 2 3 Previous Next 42 Replies Latest reply on Sep 18, 2013 5:09 AM by bhanu246 Go to original post
      • 30. Re: richfaces-3.2 - fileUpload

        You got it.

        • 31. Re: richfaces-3.2 - fileUpload

          I verified you appl. The problem was reproduced.

          The reason: old JSF version usage (1.2._04). I find out some differences with 1.2_07 where fileupload fires.

          For a quick support I can suggest you to migrate to tomcat 6.0 and newest JSF version.

          Anyway thie issue will be fixed ASAP. Please watch for fix in our JIRA.

          Thank you for your help.

          • 32. Re: richfaces-3.2 - fileUpload

            Thanks! will try it out.

            • 33. Re: richfaces-3.2 - fileUpload
              jmiguel77

              so, rich:fileUpload won't work with JBOSS 4.2.2 or JBOSS 4.2.1 ???

              the both has JSF 1.2._04 as the default jsf implementation ...

              is there not a fix for this problem yet ???

              thanks a lot

              • 34. Re: richfaces-3.2 - fileUpload

                Problems in the JSF 1.2_04 are already fixed by Sun's guys. ...or do you mean you believe, we have to write a JSF implementation patches and include them into RichFaces each time Sun's or MyFaces' dudes have bugs in milestone versions?

                • 35. Re: richfaces-3.2 - fileUpload
                  ronanker

                  well,
                  can someone explain me what is the solution, i don't see any Jboss_4.2.3 yet with JSF_1.2_07 included...

                  what should I do ? hack my Jboss 4.2.1 ? how should i do that ?

                  • 36. Re: richfaces-3.2 - fileUpload

                    RonanKER,

                    Please upgrade RF version to 3.2.1.

                    Depending of fileupload's behavior on JSF version has been fixed in 3.2.1.

                    • 37. Re: richfaces-3.2 - fileUpload
                      jonwelzel

                       

                      "andrei_exadel" wrote:
                      RonanKER,

                      Please upgrade RF version to 3.2.1.

                      Depending of fileupload's behavior on JSF version has been fixed in 3.2.1.


                      where do I find this 3.2.1 version?

                      l8er!

                      • 38. Re: richfaces-3.2 - fileUpload
                        nbelaevski
                        • 39. Re: richfaces-3.2 - fileUpload
                          ameo

                          Hello,

                          the fileUploadListener event still didn't fire in my JBoss-Portal.
                          In my portlet I select the uploading file and hit the upload button. After completion the upload the action listener didn't fire.

                          I use

                          JBoss-Portal 2.6.5
                          RichFaces 3.2.1.GA
                          JSF-RI 1.2_07

                          Could someone help me ?

                          • 40. Re: richfaces-3.2 - fileUpload
                            ilya_shaikovsky

                            could you share your project?

                            • 41. Re: richfaces-3.2 - fileUpload
                              ameo

                              here my code.

                              web.xml

                              <?xml version="1.0"?>
                              <web-app 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"
                               version="2.4">
                              
                               <description>FileUpload</description>
                               <context-param>
                               <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                               <param-value>server</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.DEVELOPMENT</param-name>
                               <param-value>false</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.SKIP_COMMENTS</param-name>
                               <param-value>true</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.VIEW_MAPPINGS</param-name>
                               <param-value>*.xhtml</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>org.ajax4jsf.VIEW_HANDLERS</param-name>
                               <param-value>org.jboss.portletbridge.application.FaceletPortletViewHandler</param-value>
                               </context-param>
                              
                               <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>true</param-value>
                               </init-param>
                               <init-param>
                               <param-name>maxRequestSize</param-name>
                               <param-value>20000000</param-value>
                               </init-param>
                               </filter>
                               <filter-mapping>
                               <filter-name>ajax4jsf</filter-name>
                               <servlet-name>FacesServlet</servlet-name>
                               <dispatcher>FORWARD</dispatcher>
                               <dispatcher>REQUEST</dispatcher>
                               <dispatcher>INCLUDE</dispatcher>
                               </filter-mapping>
                              
                              
                               <listener>
                               <listener-class>
                               com.sun.faces.config.ConfigureListener
                               </listener-class>
                               </listener>
                              
                              
                               <servlet>
                               <servlet-name>FacesServlet</servlet-name>
                               <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                               <load-on-startup>1</load-on-startup>
                               </servlet>
                               <servlet-mapping>
                               <servlet-name>FacesServlet</servlet-name>
                               <url-pattern>/faces/*</url-pattern>
                               </servlet-mapping>
                              
                              
                              </web-app>
                              


                              faces-config.xml

                              <?xml version="1.0"?>
                              <!DOCTYPE faces-config PUBLIC
                               "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
                               "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
                              <faces-config>
                               <application>
                               <view-handler>
                               org.jboss.portletbridge.application.PortletViewHandler
                               </view-handler>
                              
                              
                               </application>
                               <factory>
                               <faces-context-factory>
                               org.jboss.portletbridge.context.FacesContextFactoryImpl
                               </faces-context-factory>
                               </factory>
                              
                               <!-- Backing Beans -->
                               <managed-bean>
                               <managed-bean-name>uploadBean</managed-bean-name>
                               <managed-bean-class>de.my.BBean</managed-bean-class>
                               <managed-bean-scope>session</managed-bean-scope>
                               </managed-bean>
                              
                              </faces-config>
                              


                              BackingBean


                              public class BBean {
                              
                               private List data = new ArrayList();
                              
                               private boolean flag;
                              
                               private String fileTypes = "*";
                              
                               private Integer maxFiles = 3;
                              
                               private String width = "400";
                              
                               private String height = "210";
                              
                               public boolean isFlag() {
                               return flag;
                               }
                              
                               public List getFileList () {
                               return data;
                               }
                              
                              
                               public void setFlag(boolean flag) {
                               this.flag = flag;
                               }
                              
                               public void listener(UploadEvent event){
                               UploadItem item = event.getUploadItem();
                               System.out.println("File : '" + item.getFileName() + "' was uploaded");
                               if (item.isTempFile()) {
                               File file = item.getFile();
                               System.out.println("Absolute Path : '" + file.getAbsolutePath() + "'!");
                               file.delete();
                               }else {
                               try {
                               ByteArrayOutputStream b = new ByteArrayOutputStream();
                               b.write(item.getData());
                               System.out.println(b.toString());
                               } catch (Exception e) {
                               // TODO: handle exception
                               }
                              
                               }
                               }
                              
                              
                               /**
                               * @return the data
                               */
                               public List getData() {
                               return data;
                               }
                              
                               /**
                               * @param data the data to set
                               */
                               public void setData(List data) {
                               this.data = data;
                               }
                              
                               /**
                               * @return the fileTypes
                               */
                               public String getFileTypes() {
                               return fileTypes;
                               }
                              
                               /**
                               * @param fileTypes the fileTypes to set
                               */
                               public void setFileTypes(String fileTypes) {
                               this.fileTypes = fileTypes;
                               }
                              
                               /**
                               * @return the maxFiles
                               */
                               public Integer getMaxFiles() {
                               return maxFiles;
                               }
                              
                               /**
                               * @param maxFiles the maxFiles to set
                               */
                               public void setMaxFiles(Integer maxFiles) {
                               this.maxFiles = maxFiles;
                               }
                              
                               /**
                               * @return the width
                               */
                               public String getWidth() {
                               return width;
                               }
                              
                               /**
                               * @param width the width to set
                               */
                               public void setWidth(String width) {
                               this.width = width;
                               }
                              
                               /**
                               * @return the height
                               */
                               public String getHeight() {
                               return height;
                               }
                              
                               /**
                               * @param height the height to set
                               */
                               public void setHeight(String height) {
                               this.height = height;
                               }
                              
                              
                               public String test(){
                               if (getData() != null ){
                               String test =getData().get(0).toString();
                               System.out.println("Ausgeben:" + test );
                               }
                               return null;
                               }
                              


                              XHTML

                              <?xml version="1.0" encoding="UTF-8"?>
                              <a4j:portlet xmlns="http://www.w3.org/1999/xhtml"
                               xmlns:f="http://java.sun.com/jsf/core"
                               xmlns:ui="http://java.sun.com/jsf/facelets"
                               xmlns:h="http://java.sun.com/jsf/html"
                               xmlns:a4j="http://richfaces.org/a4j"
                               xmlns:rich="http://richfaces.org/rich">
                               <ui:composition>
                               <h:form >
                               <rich:fileUpload uploadData="#{uploadBean.data}"
                               fileUploadListener="#{uploadBean.listener}"
                               listWidth="#{uploadBean.width}" listHeight="#{uploadBean.height}"
                               maxFilesQuantity="#{uploadBean.maxFiles}" acceptedTypes="*">
                               </rich:fileUpload>
                              
                               <h:commandButton value="test" action="#{uploadBean.test}"></h:commandButton>
                              
                              
                               </h:form>
                               </ui:composition>
                              </a4j:portlet>
                              


                              • 42. Re: richfaces-3.2 - fileUpload
                                bhanu246

                                kaobiore

                                 

                                             Iam also having the same issue when i use rich:fileUpload not able to call the listener  . Iam using RF 3.3 and JBoss AS is 4.2 . Is there any solution how we can solve this ??

                                 

                                Thanks in Advance ,

                                Bhanu Prakash

                                1 2 3 Previous Next