Permalink
Browse files

SWF-1482 issue project for PrimeFaces upload.

  • Loading branch information...
1 parent 3cf6b83 commit 4eecb8f77472f131d3a61f26ddd980091108389d @geneh committed Mar 15, 2012
@@ -0,0 +1,8 @@
+This is a simple template for creating a project to reproduce
+an issue as described in the README.markdown file in the root
+of this repository (and at
+https://github.com/SpringSource/spring-webflow-issues#readme).
+Please read that document.
+
+A Maven (pom.xml) build script is included for your convenience.
+You may want to customize the dependencies it contains.
@@ -0,0 +1,246 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.springframework.webflow.issues</groupId>
+ <artifactId>SWF-1482-primefaces</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <name>Spring Web Flow and PrimeFaces Issue Reproduction Project</name>
+ <packaging>war</packaging>
+
+ <properties>
+ <java-version>1.6</java-version>
+ <org.springwebflow-version>2.3.1.BUILD-SNAPSHOT</org.springwebflow-version>
+ <org.springframework-version>3.1.1.RELEASE</org.springframework-version>
+ <org.springsecurity-version>3.0.7.RELEASE</org.springsecurity-version>
+ <jsf-version>2.1.7</jsf-version>
+ <primefaces-version>3.2</primefaces-version>
+ <org.slf4j-version>1.6.1</org.slf4j-version>
+ </properties>
+
+ <dependencies>
+ <!-- Spring Framework -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${org.springframework-version}</version>
+ <exclusions>
+ <!-- Exclude Commons Logging in favor of SLF4j -->
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>${org.springframework-version}</version>
+ </dependency>
+
+ <!-- Spring Web Flow -->
+ <dependency>
+ <groupId>org.springframework.webflow</groupId>
+ <artifactId>spring-faces</artifactId>
+ <version>${org.springwebflow-version}</version>
+ </dependency>
+
+ <!-- JSF -->
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${jsf-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${jsf-version}</version>
+ </dependency>
+
+ <!-- Primefaces -->
+ <dependency>
+ <groupId>org.primefaces</groupId>
+ <artifactId>primefaces</artifactId>
+ <version>${primefaces-version}</version>
+ </dependency>
+
+ <!-- PrimeFaces FileUpload -->
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </dependency>
+
+
+ <!-- Spring Security
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-web</artifactId>
+ <version>${org.springsecurity-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-taglibs</artifactId>
+ <version>${org.springsecurity-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>${org.springsecurity-version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ -->
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${org.slf4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${org.slf4j-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${org.slf4j-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- Servlet API, JSP API, JSTL -->
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Bean Validation with the Hibernate Validator implementation -->
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.1.0.Final</version>
+ </dependency>
+
+ <!-- JAXB for Hibernate Validator when running on Java 5
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ -->
+
+ <!-- JUnit -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+
+ <repository>
+ <id>spring-related-snapshot-releases</id>
+ <name>Latest Spring Snapshot Repository</name>
+ <url>http://maven.springframework.org/snapshot</url>
+ <releases><enabled>false</enabled></releases>
+ <snapshots><enabled>true</enabled></snapshots>
+ </repository>
+
+ <repository>
+ <id>primefaces-releases</id>
+ <name>Prime Technology Repository</name>
+ <url>http://repository.primefaces.org</url>
+ <layout>default</layout>
+ </repository>
+
+ </repositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>${java-version}</source>
+ <target>${java-version}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>sources</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*Tests.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Abstract*.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>false</downloadJavadocs>
+ <wtpversion>2.0</wtpversion>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
@@ -0,0 +1,20 @@
+package org.springframework.webflow.issues;
+
+import java.io.Serializable;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.primefaces.event.FileUploadEvent;
+
+public class FileUploadBean implements Serializable {
+
+ private static final long serialVersionUID = -7349430041081627337L;
+
+ public void handleFileUpload(FileUploadEvent event) {
+ String fileName = event.getFile().getFileName();
+ FacesMessage msg = new FacesMessage("Successful", fileName + " is uploaded.");
+ FacesContext.getCurrentInstance().addMessage(null, msg);
+ System.out.println("Uploaded file: " + fileName);
+ }
+}
@@ -0,0 +1,10 @@
+log4j.rootCategory=INFO, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
+
+log4j.category.org.springframework.binding=DEBUG
+log4j.category.org.springframework.web=DEBUG
+log4j.category.org.springframework.webflow=DEBUG
+log4j.category.org.springframework.js=DEBUG
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config 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-facesconfig_2_0.xsd"
+ version="2.0">
+
+</faces-config>
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+<f:view contentType="text/html">
+ <h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Spring Web Flow and PrimeFaces Issue Project</title>
+ </h:head>
+ <body>
+ <ui:insert name="content" />
+ </body>
+</f:view>
+</html>
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<flow xmlns="http://www.springframework.org/schema/webflow"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
+
+ <var name="fileUploadBean" class="org.springframework.webflow.issues.FileUploadBean"/>
+
+ <view-state id="view">
+ <transition on="continue" to="done" />
+ </view-state>
+
+ <end-state id="done" view="externalRedirect:contextRelative:/" />
+
+</flow>
@@ -0,0 +1,23 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:p="http://primefaces.org/ui"
+ template="/WEB-INF/layouts/standard.xhtml">
+ <ui:define name="content">
+ <div>
+ <h1>My Page</h1>
+ <h:form enctype="multipart/form-data">
+ <p:messages id="messages" showDetail="true" />
+ <p:panel header="Panel with text">
+ <p:fileUpload fileUploadListener="#{fileUploadBean.handleFileUpload}"
+ mode="advanced"
+ update="messages" />
+ </p:panel>
+ <h:commandButton id="continue" value="End Flow" action="continue" />
+ </h:form>
+ </div>
+ </ui:define>
+</ui:composition>
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <!-- Root Context: defines shared resources visible to all other web components -->
+
+</beans>
Oops, something went wrong.

0 comments on commit 4eecb8f

Please sign in to comment.