RE: ThreadLocal pattern using Spring


Spring and Vaadin can’t do this out-of-the-box, but it would be possible. I haven’t done this myself, by the way, so I might be missing something.

  1. Make sure you have the

[/code] added to your web.xml, to allow session scoped beans.

2) Add your application bean to the spring context, with a session scope[code]

<bean scope="session" id="application" class="com.acme.thing.MySuperApplication">
  1. Create your extension of com.vaadin.terminal.gwt.server.AbstractApplicationServlet, implementing getNewApplication(HttpServletRequest request) and getApplicationClass() (both looking stuff up from the context)

  2. Change your web.xml to use your new ApplicationServlet.

As I say, I’ve not tried it - but it all looks feasiblle and not very tricky.



Hey , thanks for the reply , I have some missing details , sorry for the confuse ,

I’m already using the
Spring add-on
, I have already

			  	<servlet-name>Spring Integration</servlet-name>
			  	<description>Vaadin production mode</description>


			  	<servlet-name>Spring Integration</servlet-name>



the addon class using : ( complete code and more info are in the add on )

public class SpringApplicationServlet extends AbstractApplicationServlet {

All working good , now the question is how in additional to use the ThreadLocal pattern using Spring according to the explain in the Vaadin Book :bashful: