Useful beans that can be used during development of Struts 2 base application

PatternMatcher bean

It can be used to evaluate RegExp expression in your application. It can be injected into or created by hand. Some simple example shows that below:

@Inject
public void setMatcher(PatternMatcher matcher) {
    this.matcher = matcher;
}

private boolean matchesWildcard(String pattern, String data) {
    Object exp = matcher.compilePattern(pattern);
    return matcher.match(new HashMap<String, String>(), data, exp);
}
technology/apache-struts-2-useful-beans.txt · Last modified: 2010-05-06 09:15 by Lukasz Lenart
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki