Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Stripes 1.5 in Black and White: Simpler Java Web Development : Page 3

The latest release of the Stripes MVC framework adds simplified configuration as well as support for security, AJAX, and more without forgetting its ease-of-use roots.


advertisement
New AJAX Support
In previous versions, Stripes included AJAX-friendly classes for transforming Java objects into JavaScript and streaming them to the browser. This version has added more support for AJAX-type implementations by adding a partial attribute in the Stripes form tag. Now you can include snippets of Stripes forms from other JSP pages in a larger form and refresh those areas with AJAX calls. With earlier versions, you had to use generic HTML controls to accomplish this task, sacrificing some of the power of the framework's data binding and conversion.

The following example shows how to set partial forms to true to allow your form snippets to be nested inside another Stripes form tag:

<stripes:form action="/action/User" partial="true"> <tr> <td align="right">Address:</td> <td><stripes:text name="contact.address" size="30" /></td> </tr> <tr> <td align="right">City:</td> <td><stripes:text name="contact.city" size="30" /></td> </tr> <tr> <td align="right">State:</td> <td><stripes:text name="contact.state" size="30" /></td> </tr> <tr> <td align="right">Zip:</td> <td><stripes:text name="contact.zip" size="30" /></td> </tr> <tr> <td align="right">Phone:</td> <td><stripes:text name="contact.phone" size="30" /></td> </tr> </stripes:form>



Author's Note: Check out Stripes Reload for a set of Stripes extensions that allow you to reload Stripes ActionBean classes without restarting your app server.

Upgrading from Earlier Stripes Versions
Stripes 1.5 is the first Stripes release that's not completely backward compatible with earlier versions. Nevertheless, upgrading most Stripes applications to 1.5 is pretty easy:

  1. Drop the new stripes.jar into your application's lib directory.
  2. Update the commons-logging.jar that ships with Stripes 1.5.

You may need to make some further changes as well:

  • If you used ActionResolver.UrlFilters or ActionResolver.PackageFilters to pinpoint the location of the ActionBeans in your web.xml, you'll need to update those settings to the ActionResolver.Packages.
  • If you are using the commons-fileupload.jar, you should get the latest version at the Apache site.
  • If you're using any custom extensions in your application, make sure that you now initialize them with the Extension.Packages parameter.

These changes will bring most existing Stripes applications up to speed with version 1.5, but you should still check out the upgrading.txt file that ships with this release for a full list of incompatibilities.

In addition to the enhancements discussed in this article, the Stripes framework continues to benefit from superb documentation and an active and helpful developer community.



Rick Smith is a senior software developer with Content Analyst LLC.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap