PDA

View Full Version : Inject HttpSession


jinside
Sep 12th, 2007, 04:35 AM
Hi all,
who know how to inject the HttpSession to a configured spring-bean in a web-application?
We use DWR and have no access to the HttpServletRequest-Object in our Services called by DWR :-[

greetings pete

kajh
Sep 13th, 2007, 04:46 PM
Hi!

I don't know :) but I was on an interesting talk with Matt Raible at JavaZone 2007 in Oslo, Norway today about comparing Java Web Frameworks (http://www4.java.no/web/show.do?page=92&articleid=5483)

He said a good idea when using Ajax with SpringMVC is to use XT Framework from spring-modules.

See https://springmodules.dev.java.net/docs/reference/0.8/html/xt.html

Please let me know if this is of any help.


-Kaj :)

Lyserg
Sep 14th, 2007, 12:03 PM
Hi,

i haven't worked with DWR yet. But one option is to bind the session with a servletfilter to the executing thread through a threadlocal. After that you can retrieve the session inside the execution.
After finishing the request you must unbind the session from the thread.

rgds
agim