Results 1 to 3 of 3

Thread: help with XML configuration for

  1. #1

    Default help with XML configuration for

    I haven't used Spring frameworks before but I really like what Spring Social has to offer so I am digging in.

    I would like to inject a session id into constructor rather then #{request.userPrincipal.name} as shown in the docs. Even though I am using Spring Security for this application, there will be several Users assigned to an Account and all Twitter connections should be associated with that Account. So I am trying #{session.accountId} but get an error.

    How can I use a session variable for connectionRepository constructor?

    Code:
    Field or property 'accountId' cannot be found on object of type 'org.apache.catalina.session.StandardSessionFacade'
    Code:
        
    <bean id="connectionRepository" factory-method="createConnectionRepository"
              factory-bean="usersConnectionRepository" scope="request">
      <constructor-arg value="#{session.accountId}"/>
      <aop:scoped-proxy proxy-target-class="false"/>
    </bean>
    Thank you for your time,
    Fedor

  2. #2
    Join Date
    Aug 2004
    Posts
    1,067

    Default

    If I'm understanding you correctly, I think what you're wanting to do is "#{session.getAttribute('accountId')}". The way you have it, it's trying to find an accountId property on the session (and there isn't one).
    Craig Walls
    Spring Social Project Lead

  3. #3

    Default

    Great, that's exactly what I needed. Thanks!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •