Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Servlet Session ID (Get access to the SessionID from a custom service )
Servlet Session ID [message #1755256] Wed, 01 March 2017 17:35 Go to next message
Alan Frye is currently offline Alan FryeFriend
Messages: 41
Registered: January 2017
Member
I am creating a custom service and within the custom service I would like to be able to access the current session ID in order to return it back to the client browser along with the data my service is providing.
Re: Servlet Session ID [message #1755260 is a reply to message #1755256] Wed, 01 March 2017 17:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi did you try to downcast iservicecontext.getsession to httpsessionwrapper
And ask this one for its http session. And the http session for its Id


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Servlet Session ID [message #1755373 is a reply to message #1755260] Thu, 02 March 2017 16:58 Go to previous messageGo to next message
Alan Frye is currently offline Alan FryeFriend
Messages: 41
Registered: January 2017
Member
Thanks! downcasting worked great!

Do all services have access the Context in order to get the Session ID?
Re: Servlet Session ID [message #1755376 is a reply to message #1755373] Thu, 02 March 2017 17:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i think so. did not check though

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Servlet Session ID [message #1755674 is a reply to message #1755376] Mon, 06 March 2017 18:11 Go to previous messageGo to next message
Alan Frye is currently offline Alan FryeFriend
Messages: 41
Registered: January 2017
Member
I could not find where the context(IService or Servlet) is accessible from within a validation Service. I have extended the standard validation service with my own and I need to capture the HTTP Session ID(JESSIONID) from within my the service. Any ideas would be appreciated.
Re: Servlet Session ID [message #1755676 is a reply to message #1755674] Mon, 06 March 2017 18:22 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
guess you have to customize org.eclipse.xtext.web.server.XtextServiceDispatcher.getValidationService(IServiceContext)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Inheriting from Java based validator fails due to changed naming
Next Topic:Two DSL, single project, Activator&injector issues
Goto Forum:
  


Current Time: Thu Apr 25 17:06:03 GMT 2024

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

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

Back to the top