About me • Senior Java Engineer and Web Advocate at Present Technologies • Open source enthusiast • Web standards contributor • Casual blogger Present Technologies 2
Why “Have you ever used a framework and felt you had to do too much work for the framework compared to what the framework gave you in return?” Freddy Daoud, Stripes Book Present Technologies 5
What is it • Stripes is a Model-View-Controller (MVC) framework • Stripes is not a “full-stack” framework • Stripes is an action-based framework Present Technologies 6
Goals • Make developing web applications in Java easy • Provide simple yet powerful solutions to common problems • Make the Stripes ramp up time for a new developer less than 30 minutes • Make it really easy to extend Stripes, without making you configure every last thing From Stripes Homepage Present Technologies 7
Features - Smart binding Localized buttons and labels Present Technologies 11
com.example.javapt09.stripes.action.SmartBindingActionBean.user.firstName=First name com.example.javapt09.stripes.action.SmartBindingActionBean.user.lastName=Last name com.example.javapt09.stripes.action.SmartBindingActionBean.print=Print
Features - Validation Frequently used @Validate attributes Present Technologies 12 Attribute Type Description field String Name of nested field to validate. required boolean true indicates a required field. on String[] Event handlers for which to apply. minlength int Minimum length of input. maxlength int Maximum length of input. expression String EL expression to validate the input. mask String Regular expression that the input must match. minvalue double Minimum numerical value of input. maxvalue double Maximum numerical value of input. converter Class Type converter to use on the input.
Features - Validation Custom Validation Present Technologies 14 @ValidationMethod public void validate(ValidationErrors errors) { if (user.getLastName().equals(user.getFirstName())) { errors.add("lastName", new SimpleError("First and last name must be different!")); } }
Features - Clean URLs DynamicMappingFilter Static resources can be delivered from the same namespace to which an ActionBean is mapped using clean URLs. Present Technologies 17
Features - Layouts Using a reusable layout to render a page Present Technologies 19 <%@include file="/WEB-INF/jsp/common/taglibs.jsp" %> title="JavaPT09 - Stripes » Layouts">
Features - Easy Ajax integration Present Technologies 25 public class AjaxActionBean extends BaseActionBean { private List cities = new ArrayList(); public Resolution load() { return new JavaScriptResolution(cities); } }
Features - Extension/customization • Stripes uses auto-discovery to find extensions • The specified packages will be scanned for extensions like interceptors, formatters, type converters, exception handlers, etc Present Technologies 29
Extensions • Stripes-Reload Reloads modifications made to your Action Beans, Type Converters, Formatters, and Resource Bundles without having to restart your server. http://code.google.com/p/stripes-reload/ Present Technologies 32
Find more • Stripes Framework http://www.stripesframework.org • Stripes Book: Stripes ...and Java Web Development Is Fun Again http://pragprog.com/book/fdstr/stripes Present Technologies 33