HttpSession Access in GWT & Spring Application

114 views
Skip to first unread message

Niraj Salot

unread,
Oct 8, 2012, 7:47:11 AM10/8/12
to google-we...@googlegroups.com
Hi All,

I am currently using GWT , Spring & Custom JDBC in my application.

I require some data to be put in Session and used everywhere in the application. So I have written one Utility class which has getSession() method and setObject() and getObject() Method().

I would like your opinion on the API used below

public static HttpSession getSession() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
.currentRequestAttributes();
return attributes.getRequest().getSession(false);
}

I hope that there is nothing wrong in using RequestContextHolder class of Spring for getting the Session Object.

Let me know if something is wrong.

Thanks,Niraj.
Reply all
Reply to author
Forward
0 new messages