Archives for categorie "Seam"

Upload files using Flex and Seam:
- Prepare FileReference class to use a servlet in the server. You can use this example with Apache libraries commons-fileupload-1.2.1 and commons-io-1.4.
- Register the servlet in file configuration web.xml
- IMPORTANT: Modify Seam configuration to allow file upload in

components.xml:

<web:multipart-filter create-temp-files="true"
	max-request-size="1048576"
        url-pattern="*.seam"/>     

and on web.xml:

<filter>
	<filter-name>Seam Multipart Filter</filter-name>
        <filter-class>org.jboss.seam.web.MultipartFilter</filter-class>
</filter>

<filter-mapping>
	<filter-name>Seam Multipart Filter</filter-name>
	<url-pattern>*.seam</url-pattern>
</filter-mapping>   

More information about configuration in the Seam documentation.

JBoss Tools allow us to generate a basic configuration of a Seam project very easy, but we can use too a Dinamyc Web configuration in Eclipse to use only javabean components:

  1. Create a Dinamyc Web project
  2. Add Seam jar
  3. Include configuration files in Seam
  4. Define components and logic to the application

Download the example with Eclipse and JBoss:

Very important, JavaBean components are loaded automatically, but it’s necessary include (although it was empty) the file seam.properties in classes folder.

More information about Seam configuration in Configuring Seam and packaging Seam applications.

Creative Commons License
This blog is under Creative Commons licence, unless indicated otherwise.
Special thanks to Mark James for the icon set used in this blog.