-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
my web-app makes use of GenericForwardComposer to populate my zuls.
I want to use spring (security) to protect methods of my services. As far as i understand the services have to be instantiated by the spring framwork to make the @Secured annotations etc. work.
I looked at the zkspring sample code and they all use Servlets, which are controlled by Spring. So there's no problem to autowire an instance of your service. This autowired instance is controlled by spring and the securiy annotations work just fine.
I managed to get Spring to instantiate my service by defining a bean in a xml file and get this bean with the SpringUtil.getBean(myService"); The security annotations work this way, but i'd rather have this services autowired.
Do any of you have an idea how to achieve this?
Thanks in advance,
Antigo
Can you provide example code of you Spring XML configuration and and how you intend or want to use it.
I've got Spring Security working with ZK but restricting it based on user role and URI path, but without annotations.
I want to use security annotations in my service and domain-object layer. As i said the annotations do work if the instantiation is made by Spring.
I found this piece in the spring documentation: http://static.springsource.org/spring-security/site/docs/3.0.x/reference/secure-object-impls.html
It says "That's it! Now you can create your beans from anywhere within your application, using whatever means you think fit (eg new Person();) and they will have the security interceptor applied."
Sounds exactly like what i need. I just have to figure out how it works ^^
Asked: 2011-07-18 05:09:05 +0800
Seen: 264 times
Last updated: Jul 19 '11