I wonder if anyone can help.
I'm trying to write a
struts 2 component and as part of that I am trying to use XWork's DI (I've decided to post here as I think its more to do with
Java annotations rather than struts or xworks)
I want to use the struts2 / xworks Inject annotation to get a value from the struts properties files into my class. Esssentially this is what I want to do:
Where 'fred' in the example is the name of a property in the properties file. Obviously 'fred' is a value I've used to
test what happens when the name/value pair is not found in the properties file. In this case the xworks class throws an exception.
This is fine, except I cant work out how to catch the exception! I am not familiar with java5 annotations (I cut my teeth on the 1.4 stream
![](https://coderanch.com/images/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif)
) - so if anyone could point me in the right direction I'd very much appreciate it.
Thanks
Nathan