Announcement Announcement Module
Collapse
No announcement yet.
annotations Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • annotations

    I've been trying to get annotations working for the past day, and I can't figure out what I'm doing wrong. What is happening is that the method that I've marked as @Secure isn't filtering anthing.

    public interface GenericSecure {
    @Secured({"ROLE_ADMIN"})
    public int click(int counter);
    }

    Am I missing something, or is my understanding of what is supposed to happen different from what is happening?

    Thanks.

  • #2
    Re

    hi members
    I don't know if you imlemented all the fatory in your file of configuration:
    SecurityAnnotationAttributes, MethodDefinitionAttributes and BeanNameAutoProxyCreator.
    I supposed that you added all the necessary JAR files in your lib.

    Comment


    • #3
      Originally posted by badi007 View Post
      hi members
      I don't know if you imlemented all the fatory in your file of configuration:
      SecurityAnnotationAttributes, MethodDefinitionAttributes and BeanNameAutoProxyCreator.
      I supposed that you added all the necessary JAR files in your lib.
      Here's my config file:

      <bean id="attributes" class="org.acegisecurity.annotation.SecurityAnnota tionAttributes"/>
      <bean id="objectDefinitionSource" class="org.acegisecurity.intercept.method.MethodDe finitionAttributes">
      <property name="attributes"><ref local="attributes"/></property>
      </bean>
      <bean id="securityInterceptor" class="org.acegisecurity.intercept.method.aopallia nce.MethodSecurityInterceptor">
      <property name="validateConfigAttributes"><value>false</value></property>
      <property name="authenticationManager"><ref bean="authenticationManager"/></property>
      <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
      <property name="objectDefinitionSource"><ref bean="objectDefinitionSource"/></property>
      <property name="runAsManager"><ref bean="runAsManager"/></property>
      </bean>

      Comment


      • #4
        I think some people have had problems putting the annotation on the interface or class depending on what type of proxying they are using. It might be worth searching the forums.

        Comment


        • #5
          I ended up getting this working. My problem wasn't with the syntax of the annotations or the beans, but rather how Spring loaded the interceptor.

          Comment


          • #6
            Originally posted by AgentHubcap View Post
            I ended up getting this working. My problem wasn't with the syntax of the annotations or the beans, but rather how Spring loaded the interceptor.
            So what was the solution?

            Comment

            Working...
            X