Some error handling thoughts
Cantor, Scott
cantor.2 at osu.edu
Thu Jan 2 21:48:44 EST 2014
Mostly just FYI...
I was thinking abot how to code an action to populate non-Success status
information in a SAML message when I took a detour into how we might
translate WebFlow Event IDs into error messages. We have mostly really
generic "sanity check" Events right now, but now that the profiles are
getting closer to real, I think we'll want more semantically interesting
Events to drive error handling.
Anyway, I was going to work on some kind of message catalog, but I figured
I'd check into Spring's capabilities, which was good because they
basically do all this for us and I was able to wire that up in about 10
minutes.
I coded some delegated methods on the Spring-aware Action base class to
handle getMessage() calls, and that delegates to the parent context, which
is wired with a ReosurceBundle that does standard Java message files in
property or XML syntax, with Locale-based i18n (the locale should be
derivable from the browser Accept-Language header). It also can refresh
the message files automatically on changes, so that's free too.
Mostly all done with this one bean:
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessage
Source"
p:cacheSeconds="300" p:basename="file://${idp.home}/conf/messages" />
-- Scott
More information about the dev
mailing list