Even if I put this bean in ApplicationContext?
Even if I put this bean in ApplicationContext?
It depends on how object is instantiated in the application. If object is obtained from application context, as Marten said, applicationContext.getBean(...) then target object is wrapped by proxy, proxy does authorization. Spring AOP is proxy-based.
The alternative ways can be:
- using AspectJ-Spring integration via load-time weaving
http://static.springsource.org/sprin...-using-aspectj
- trying to use some extention points during domain object retriving, for example, in Hibernate curtom PojoEntityTuplizer + custom PojoInstantiator; in spring jdbc support custom RowMapper or custom ResultSetExtractor
Thank you for your answers
I'm afraid I have no one bean in my application wich I get like this
There was no need to do it, while I stupidly follow sample given in bookHTML Code:applicationContext.getBean(...)
Agile Java Development with Spring, Hibernate and Eclipse
by Anil Hemrajani
http://my.safaribooksonline.com/0672328968
May be I should have another tuturial. Please give me links to the simpliest hands on project on the subject of Spring security
Thank you!