Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page walks through techniques that can be used in Stripes to reduce the amount of configuration (usually in the form of annotation) that is necessary on a per-ActionBean basis.

URL Bindings and Event Names

...

Code Block
titleA customized action resolver
 
public class MyActionResolver extends NameBasedActionResolver { 
	@Override 
	public Set<String> getBasePackages() { return Literal.set("ui", "client"); } 
	@Override 
	public String getBindingSuffix() { return ".do"; /* ugh */ } 
} 

...

Now, if you created your own TypeConverter you could use it by attaching a single annotation to your property:

Code Block
 
@Validate(converter=MoneyTypeConverter.class) 
private Money balance; 

...

Code Block
titleA custom TypeConverterFactory
 
public class CustomTypeConverterFactory extends DefaultTypeConverterFactory { 
	public void init(Configuration configuration) { 
		super.init(configuration); 
		add(Money.class, MoneyTypeConverter.class); 
	} 
} 

To see how to configure an alternate TypeConverterFactory take a look at the Configuration Reference.