Announcement Announcement Module
Collapse
No announcement yet.
help with XML configuration for Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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).

    Comment


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

      Comment

      Working...
      X