aspose file tools*
The moose likes Spring and the fly likes DWR and Spring Scoped Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "DWR and Spring Scoped Beans" Watch "DWR and Spring Scoped Beans" New topic
Author

DWR and Spring Scoped Beans

Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Hello,
Thanks for reading my post; hopefully I'm in the right forum.

I'm having some intermittent issues getting a session from the WebContext; sometimes it's null. This seems to be related to concurrent users. So, I found this article: http://directwebremoting.org/dwr/documentation/server/integration/spring.html#springCreator and http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-global-session which explains beans can be scoped. I tried to implement the solution provided on both of these links but this solution is working for me (see below). Am I missing something?

This is what I've done:



springbeans.xml
<bean id="orgDelegate" class="com.example.dwr.OrganizationDelegate" scope="session">
<dwr:remote javascript="OrganizationDelegate">
<dwr:include method="getOrgStreetName"/>
</dwr:remote>
<aop:scoped-proxy proxy-target-class="false" />
</bean>

web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>

Thanks inadvance for your help!
Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
Sorry, this should read:

I tried to implement the solution provided on both of these links but this solution is NOT working for me (see below).
Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 197
This link helped me resolve my issue. Maybe this will help someone else who could also run into this issue: http://forum.springsource.org/archive/index.php/t-26302.html
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DWR and Spring Scoped Beans
 
Similar Threads
Acegi Configuration
web.xml deployment problem
No thread-bound request found [Spring]
Struts-JSP Application
How to use Spring / DWR Revers Ajax functionality to display dynamic changes to table data