Skip navigation

Release Notes 2.0
Added by Matt Raible, last edited by Matt Raible on Sep 18, 2007 11:53

Toggle Sidebar

The road to AppFuse 2.0 has been a long journey through Mavenland, annotations and generics. We're pleased to announce that we're finally finished after 13 months of development. Thanks to all the developers, contributors and users for helping test, polish and prove that AppFuse 2 is an excellent solution for developing Java-based applications. Your time, patience and usage of AppFuse has made it the strong foundation it is today.

This release contains a number of bug fixes for AMP, an upgrade to Tapestry 4.1.3, the addition of Tacos, support for Oracle and changes to prevent XSS attacks.

Please see about the AppFuse Maven Plugin (AMP) for more information on how to generate code and import AppFuse source into your project.

Please see the Upgrade Guide below or the QuickStart Guide to get started with this release.

Upgrade Guide

If you're currently using AppFuse 2.0 RC1, here's a few things you'll need to change to upgrade to 2.0 Final. If you're using a version prior to 2.0 RC1, you may want to follow previous upgrade instructions first.

Diff is your friend
The easiest way to make the changes below might be to compare your pom.xml, xfire-servlet.xml, web.xml and web-tests.xml with the ones from a new archetype. Beyond Compare is a fabulous diff tool for Windows users. To do this, create a new project using 2.0, then compare the top-level directory of your project with the new one.

The tutorial applications have been upgraded from 2.0 M5 to 2.0. Looking at the diffs for these projects may be one of the easiest ways to upgrade. NOTE: These patches use 2.0-SNAPSHOT as the AppFuse version. You'll want to use 2.0 in your project.

If you've used war:inplace
If you've used mvn war:inplace in your project, make sure you remove your WEB-INF/classes and re-run war:inplace:

rm -r src/main/webapp/WEB-INF/classes

The following are a detailed set of steps you'll need to do if you're manually upgrading your project from a previous 2.x version.

  1. Backup your project on your local file system or (even better) in your source control system.
  2. In your pom.xml, change <appfuse.version> to 2.0.
  3. Maven's war overlay feature is based on timestamps. If you've overridden AppFuse files in your project, you'll need to "touch" them in order to give them a newer timestamp. Here's a sample of what you might run:
    touch src/main/webapp/*
    touch src/main/webapp/scripts/*
    touch src/main/webapp/WEB-INF/*
    touch src/main/webapp/WEB-INF/pages/*
    Another, more permanent, solution is to use <dependentWarExcludes> to prevent the files from being overlayed.
  4. If you'd like to use AspectJ in your project, add the aspectj-maven-plugin to your pom.xml. See APF-776 for more information on how to do this.
  5. If you're concerned about XSS attacks, you can modify your project to prevent HTML from being processed in success and error messages using the following steps:
    1. If you have messages.jsp in your project, you'll want to modify it so it doesn't process HTML tags in messages it renders. To do this, remove escapeXml="false" from <c:out> tags and escape="false" from <s:property> tags if you're using Struts 2.
    2. Find/replace <strong>{...}</strong> in your ApplicationResources.properties with {...}.
    3. Find/remove <strong> and </strong> from your web-tests.xml.
  6. Upgrade the maven-warpath-plugin to version ${appfuse.version} where <appfuse.version> is set to 2.0 in your pom.xml. See APF-885 for more information on why we changed this plugins version from 1.0 to 2.0.
  7. Upgrade the maven-eclipse-plugin to version 2.4.
  8. Upgrade the maven-idea-plugin to version 2.1.
  9. Upgrade the hibernate3-maven-plugin to version 2.0-alpha-2.
  10. Upgrade the maven-jetty-plugin to version 6.1.5.
  11. Change <junit.version> to 4.4 and <wiser.version> to 1.2.
  12. Change the maven-jetty-plugin from using <scanTarget> to use <scanTargetPatterns>. Exclude *.jsp and any other extensions for your web framework.
    <scanTargetPatterns>
        <scanTargetPattern>
            <directory>src/main/webapp/WEB-INF</directory>
            <excludes>
                <exclude>**/*.jsp</exclude>
            </excludes>
            <includes>
                <include>**/*.properties</include>
                <include>**/*.xml</include>
            </includes>
        </scanTargetPattern>
    </scanTargetPatterns>
  13. Remove any dependencies from the maven-jetty-plugin as they're no longer needed.
  14. In the <resources> section of your pom.xml, exclude applicationContext-resources.xml and add a new <resource> element with this file and turn off filtering. See APF-883 for more information about the problem this solves. You'll want to do the same for struts.xml if you're using Struts 2 as your web framework.
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>applicationContext-resources.xml</include>
        </includes>
        <filtering>false</filtering>
    </resource>
  15. JSF: Change the <groupId> of the jsp-api artifact to javax.servlet.jsp. You'll also need to change its version to 2.1.
  16. JSF: Add a dependency on shale-test for testing your managed beans.
    <dependency>
        <groupId>org.apache.shale</groupId>
        <artifactId>shale-test</artifactId>
        <version>1.0.4</version>
        <scope>test</scope>
    </dependency>

    You'll also need to change your tests to accomodate this change. Please see the Using JSF tutorial to see the new syntax for JSF tests.

  17. Change the dependencies for Canoo WebTest to be as follows:
    <dependency>
        <groupId>com.canoo.webtest</groupId>
        <artifactId>webtest</artifactId>
        <version>${webtest.version}</version>
        <!-- groovy-all doesn't have a pom in central repo -->
        <!-- exclude groovy to prevent trying to fetch pom -->
        <exclusions>
            <exclusion>
                <groupId>groovy</groupId>
                <artifactId>groovy-all</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
  18. If you'd like to use Oracle for your database, change all the primary keys in sample-data.xml to use negative values (for example, -1 instead of 1). You may need to update your web-tests.xml file accordingly.
  19. Change the <webtest.version> property to be R_1600. You can also remove the following properties: <javamail.version>, <log4j.version>, <oro.version>.
  20. Change the <cargo.container.url> to point to Tomcat 6:
    http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.zip
  21. To increase performance, lazy initialization of Spring beans has been turned on by default. To do this in your applicationContext.xml files, add default-lazy-init="true" to their <beans> element.
  22. If you want to use DWR, change your web.xml so the staticFilter's includes <init-param> contains /dwr/*.
  23. Modify the <filter-mapping> for SiteMesh so it contains <dispatcher>INCLUDE</dispatcher> in addition to REQUEST and FORWARD.
  24. Admin-only screens have been moved to /admin/*. You will need to update your web framework's configuration file as well as web-tests.xml, menu-config.xml and possibly urlrewrite.xml if you want this feature in your project. See APF-673 for more information. Click on the "Fisheye" tab to see diffs for files changed in AppFuse.
  25. In your applicationContext-resources.xml file, on the dataSource bean, remove the maxIdle, removeAbandoned and removeAbandonedTimeout properties. Add poolPreparedStatements as a property and set its value to true.
  26. In web.xml, the contextConfigLocation context-param has been changed to reduce usage of classpath*:. The new recommended value is:
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            classpath:/applicationContext-resources.xml
            classpath:/applicationContext-dao.xml
            classpath:/applicationContext-service.xml
            classpath*:/applicationContext.xml
            /WEB-INF/applicationContext*.xml 
            /WEB-INF/xfire-servlet.xml
            /WEB-INF/security.xml
        </param-value>
    </context-param>
  27. Add ApplicationResources_ko.properties if you need Korean support. You'll also need to configure the native2ascii plugin in your pom.xml to make sure this file is processed correctly.
  28. JSF: In faces-config.xml, change it from using a DTD to using a JSF 1.2 XSD:
    <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_1_2.xsd"
        version="1.2">
  29. JSF: Add "it" and "ko" as supported locales if you have them in your src/main/resources directory.
  30. JSF: If you want to use Acegi's JSF support in your project, add /WEB-INF/taglibs/acegijsf.taglib.xml to the facelets.LIBRARIES value in your web.xml.
  31. Struts 2: Add struts.xml to the list of files in the <warPathExcludes> element of your pom.xml.
  32. Tapestry: You can delete all the tapestry*.properties files in your WEB-INF directory. You will need to add the following line to your tapestry.application as well:
    <meta key="org.apache.tapestry.namespace-properties-name" value="ApplicationResources"/>
  33. Tapestry: Change the <filter-mapping> in web.xml from <url-pattern>/*</url-pattern> to /scripts/* and /styles/*. The reason this change is needed is because Tapestry 4.1.x gzips its content by default.
  34. Tapestry: Add the following line to src/test/resources/config.xml:
    <option name="ThrowExceptionOnScriptError" value="false"/>

    This is needed because Canoo WebTest has some issues with Dojo.

  35. Tapestry: Change references in *ListTest.java classes from setServiceParameters() to setListenerParameters().

About the AppFuse Maven Plugin

This release marks the third release of the AppFuse Maven Plugin (AMP). This plugin currently does two things: 1) code generation for CRUD and 2) allows you to convert your project to use AppFuse's source instead of using its binary dependencies.

Generating CRUD with AMP

In the 2.0 release, you can run the following command to generate CRUD screens/classes for a POJO:

mvn appfuse:gen -Dentity=Name

If you don't specify the entity name, you will be prompted for it. Currently, if a @Column has "nullable = false", a "required field" validation rule will be generated as part of the web framework's validation configuration. This command will also install the generated code, unless you specify -DdisableInstallation=true.

If your entity is not defined in hibernate.cfg.xml, it will be added.

In a modular project, these commands must be run in the "core" and "web" modules. The plugin is smart enough to figure out when it should/should not generate stuff based on the packaging type (jar vs. war). If you want to generate specific code in a "war" project, you can use gen-core or gen-web.

New in 2.0
A new goal has been added in 2.0. Now you can run mvn appfuse:remove to remove the artifacts installed by appfuse:gen.

There's also a goal that allows you to generate model objects from database tables.

appfuse:gen-model

This goal will install the generated files into your source tree, unless you specify -DdisableInstallation=true. After running this command, you can use appfuse:gen to generate CRUD classes/tests/screens for this object.

Installing AppFuse's source into your project

The good news is creating an "old style" project is now pretty easy. If you create a new project using 2.0, you can use:

mvn appfuse:full-source

This goal will convert your project to use all of AppFuse's source and remove all dependencies on AppFuse.

What the full-source plugin does:

  1. Exports all sources from Subversion into your project. It reads the dao.framework and web.framework properties to determine what you need.
  2. Removes warpath plugin from pom.xml.
  3. Calculates dependencies by reading pom.xml files form the various AppFuse modules. It replaces your dependencies with these new ones. The order of the dependencies added is alphabetical based on groupId.
  4. Reads properties from the root AppFuse pom.xml and adds the ones that don't exist to your project. The order of the properties added is alphabetical.
  5. Renames packages from org.appfuse to your project's groupId.

If you have issues developing AppFuse in Eclipse or NetBeans because of the WarPath plugin, running appfuse:full-source should fix that problem. It removes the warpath plugin as part of its installation process.

Detailed Changelog

AppFuse JIRA (32 issues)
T Key Summary Status Res
New Feature APF-893 Create Tutorial showing how to switch from MyFaces to Sun's RI ResolvedResolved FIXED
Bug APF-892 Using full-source on Windows corrupts i18n bundles ResolvedResolved FIXED
Bug APF-891 Struts 2 Basic project doesn't work with jetty:run after full-source ResolvedResolved FIXED
Bug APF-889 In sample-data.xml it doesn't add Foreign Key fields ResolvedResolved FIXED
Bug APF-888 Using full-source fails on projects that use tabs instead of spaces in their pom.xml ResolvedResolved FIXED
Bug APF-887 Running full-source on a project with dao.framework = jpa results in test failures ResolvedResolved FIXED
Bug APF-886 jdbc.properties is overwritten with deployed version if deployed has newer timestamp ResolvedResolved FIXED
Improvement APF-885 Change warpath plugin to version 2.0 instead of 1.0 ResolvedResolved FIXED
Improvement APF-884 Improve startup performance ResolvedResolved FIXED
Bug APF-883 applicationContext-resources.xml has jdbc.* variables replaced in compile phase ResolvedResolved FIXED
Improvement APF-882 Add "appfuse:remove" Mojo to allow remove generated CRUD ResolvedResolved FIXED
Improvement APF-881 Upgrade to Tapestry 4.1.3 ResolvedResolved FIXED
Improvement APF-880 messages.jsp - cross site scripting ResolvedResolved FIXED
Bug APF-879 Menu not working correctly in certain cases ResolvedResolved FIXED
Bug APF-878 mvn jetty:run exception after war:inplace using Struts Basic archetype ResolvedResolved FIXED
Improvement APF-877 Upgrade to Acegi Security 1.0.5 ResolvedResolved FIXED
Bug APF-876 appfuse:full-source doesn't work on modular projects when using Windows ResolvedResolved FIXED
Bug APF-875 AMP results in a FATAL ERROR when entity doesn't exist or doesn't have @Entity ResolvedResolved FIXED
Improvement APF-874 Change groupId of appfuse-maven-plugin to org.appfuse ResolvedResolved WON'T FIX
Bug APF-873 Error when trying to run mvn appfuse:full-source for core archetype ResolvedResolved FIXED
Improvement APF-872 Add LogFactory.release() for Commons Logging ResolvedResolved WON'T FIX
Bug APF-859 Active Users list not rendering Full Name properly ResolvedResolved FIXED
Bug APF-846 Exception when jetty tries to restart webapp after change in watched files ResolvedResolved WON'T FIX
Bug APF-838 On the Add User Form, the Delete button should not be displayed after the Save has not been successful ResolvedResolved FIXED
Bug APF-793 appfuse:install fails: expects generated-sources ResolvedResolved FIXED
Bug APF-792 appfuse:gen class name used in stead of package name+class name? ResolvedResolved WON'T FIX
Bug APF-783 Adding core classes breaks "mvn site" ResolvedResolved FIXED
Bug APF-778 Umlaute are displayed incorrect althougt correct encoding in ApplicationProperties_de and native2Ascii in pom.xml ResolvedResolved FIXED
Bug APF-718 Unique constraint violated when running test-all ResolvedResolved FIXED
Task APF-703 Upload AppFuse 2.0 RC1 to Maven's Central Repository ResolvedResolved FIXED
Bug APF-689 Roles not loaded into DB with Oracle ResolvedResolved FIXED
New Feature APF-413 Add Tacos to Tapestry version of AppFuse ResolvedResolved FIXED


Adaptavist Theme Builder Powered by Atlassian Confluence