Page tree
Skip to end of metadata
Go to start of metadata

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

Icon

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

Icon

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.
  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.
  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.
    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:
  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:
  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:
  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:
  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:
  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:
    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:

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

Icon

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.

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:

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

Loading
T Key Summary Status Resolution