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: 28
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: 11367
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


Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
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: 28
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: 11367
Registered: July 2009
Senior Member
i think so. did not check though

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
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: 28
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: 11367
Registered: July 2009
Senior Member
guess you have to customize org.eclipse.xtext.web.server.XtextServiceDispatcher.getValidationService(IServiceContext)

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
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: Tue Nov 21 01:01:33 GMT 2017

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

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