You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Martin Gainty (JIRA)" <ji...@apache.org> on 2009/06/18 12:59:08 UTC

[jira] Commented: (AXIS2-4394) transportsession scope doesn't work with spring

    [ https://issues.apache.org/jira/browse/AXIS2-4394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721190#action_12721190 ] 

Martin Gainty commented on AXIS2-4394:
--------------------------------------

You can control not only the various dependencies and configuration values that are to be plugged into an object that is created from a particular bean definition, but also the scope  of the objects created from a particular bean definition. This approach is very powerful and gives you the flexibility to choose the scope of the objects you create through configuration instead of having to 'bake in' the scope of an object at the Java class level. Beans can be defined to be deployed in one of a number of scopes: out of the box, the Spring Framework supports exactly five scopes (of which three are available only if you are using a web-aware ApplicationContext).

singleton:
Scopes a single bean definition to a single object instance per Spring IoC container.
application-context.xml example:
<bean id="accountService" class="com.foo.DefaultAccountService"/>

prototype:
Scopes a single bean definition to any number of object instances.
application-context.xml example:
<bean id="accountService" class="com.foo.DefaultAccountService" scope="prototype"/>

request:
Scopes a single bean definition to the lifecycle of a single HTTP request; that is each and every HTTP request will have its own instance of a bean created off the back of a single bean definition. Only valid in the context of a web-aware Spring ApplicationContext.
Servlet 2.4. web container example:
<web-app>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>
</web-app>
<bean id="loginAction" class="com.foo.LoginAction" scope="request"/>

session:
Scopes a single bean definition to the lifecycle of a HTTP Session. Only valid in the context of a web-aware Spring ApplicationContext.
Servlet 2.4 web container example:
<web-app>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>
</web-app>
<bean id="userPreferences" class="com.foo.UserPreferences" scope="session"/>

global session (generally used for Portlets):
Scopes a single bean definition to the lifecycle of a global HTTP Session. Typically only valid when used in a portlet context. Only valid in the context of a web-aware Spring ApplicationContext.
Servlet 2.4 web container example:
<web-app>
  <listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
  </listener>
</web-app>
<bean id="userPreferences" class="com.foo.UserPreferences" scope="globalSession"/>

http://static.springframework.org/spring/docs/2.0.8/reference/beans.html



> transportsession scope doesn't work with spring
> -----------------------------------------------
>
>                 Key: AXIS2-4394
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4394
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Integration
>         Environment: Axis2 1.4.1
>            Reporter: Ofer Deitelzweig
>
> I have a transportsession scoped web service that works well under tomcat.
> I'm trying to integrate this web service with spring (following the documentation) and it fails to work the same.
> What happens is that sessions get mixed up. Different users with differenet credentials see the same data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.