Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Servlet Session in RAP
Servlet Session in RAP [message #1710058] Sat, 03 October 2015 13:31 Go to next message
Arif Sorathia is currently offline Arif SorathiaFriend
Messages: 5
Registered: December 2012
Junior Member
Hello,

I am adding an attribute in a servlet session using following code
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
req.getSession().setAttribute("USER",userObject);
}


and i am trying to access in in RAP ApplicationWorkbenchWindowAdvisor class postWindowOpen method like following

RWT.getRequest().getSession().getAttribute(USER)


above scenario is not working after i migrate to RAP version 3.0. in RAP 2.0 it was working fine.
Re: Servlet Session in RAP [message #1710586 is a reply to message #1710058] Wed, 07 October 2015 18:08 Go to previous messageGo to next message
Arif Sorathia is currently offline Arif SorathiaFriend
Messages: 5
Registered: December 2012
Junior Member
waiting for the kind reply
Re: Servlet Session in RAP [message #1710640 is a reply to message #1710586] Thu, 08 October 2015 07:22 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
is the HTTP session the same in both places?
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Servlet Session in RAP [message #1712146 is a reply to message #1710058] Wed, 21 October 2015 14:04 Go to previous messageGo to next message
Ivan Nemeth is currently offline Ivan NemethFriend
Messages: 3
Registered: July 2009
Junior Member
Hi,

I have the same problem. In our app we authenticate the user with the help of Spring's security framework. On first access the user is redirected a login page, and after successful authentication the valid security details are written into the session. After this the user is redirected to the RAP application, and the valid security is read from the session and stored in RAP UI display thread as a ThreadLocal. This worked fine with previous versions, but in the 3.0 version doesn't work anymore. The reason is what Arif said, that the login request and the rap ui have the same session, but different servletcontext, so the security details attribute is not accessible. Although OSGI http registry enables to register resources and servlets with a predefined httpcontext, but it doesn't work either because the RWTServlet's httpcontext isn't accessible. (As I see it is created in ApplicationReferenceImpl as a wrapped httpcontext.)
It seems to me that currently there is no way to share session attributes between the RWT app and other servlets (including those which are created through the http registry extension). Is there any plan to change this behaviour?

Regards,
Ivan Nemeth


[Updated on: Wed, 21 October 2015 14:44]

Report message to a moderator

Re: Servlet Session in RAP [message #1712149 is a reply to message #1712146] Wed, 21 October 2015 14:32 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
please file a bugzilla with a simple test project to reproduce it and we
will look on it asap.
Regards,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Servlet Session in RAP [message #1712166 is a reply to message #1712149] Wed, 21 October 2015 16:28 Go to previous message
Ivan Nemeth is currently offline Ivan NemethFriend
Messages: 3
Registered: July 2009
Junior Member
Hi Ivan,

created a bug report:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=480326

Thanks,
Ivan Nemeth
Previous Topic:Hover and MouseListener on Composite with children
Next Topic:titilearediallog
Goto Forum:
  


Current Time: Tue Mar 19 05:00:02 GMT 2024

Powered by FUDForum. Page generated in 0.01861 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top