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: 16
Registered: January 2017
Junior 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: 10543
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
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: 16
Registered: January 2017
Junior 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: 10543
Registered: July 2009
Senior Member
i think so. did not check though
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: 16
Registered: January 2017
Junior 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: 10543
Registered: July 2009
Senior Member
guess you have to customize org.eclipse.xtext.web.server.XtextServiceDispatcher.getValidationService(IServiceContext)
Previous Topic:Two DSL, single project, Activator&injector issues
Next Topic:How to run automatically generated java file has a method main in Xtext generator ?
Goto Forum:
  


Current Time: Fri May 26 01:51:17 GMT 2017

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

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