Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest()
[Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1008990] Thu, 14 February 2013 09:05 Go to next message
peter meyer is currently offline peter meyerFriend
Messages: 13
Registered: September 2012
Junior Member
Hello Martin,

we are evaluating Texo for a RCP Client/Tomcat server project.

In the Tomcat Server we run one webapp for CRUD data operations with Texo jsonws, in the same Tomcat we run Birt for serverside report generation. Both webapps need authorisation. We want to use the single sign on mechanismen which tomcat provide. This mechnismen use session/cookie information and share it between webapps in the same host.

To use this cool feature we must must be able to get and store session information from the HTTP Request in the RCP Client and put it in the following requests.

The communication of our RCP Client starts with a JSONEObjectStore.doHTTPRequest.

Would it be possible to provide in the JSONEObjectStore a method

afterConnect(HttpURLConnection con)

with the established HttpURLConnection as parameter, which is called in the doHTTPRequest method after the connection is established?


We could override this method (like beforeConnect) and get information from the connection.

best regards
Peter

[Updated on: Thu, 14 February 2013 09:06]

Report message to a moderator

Re: [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1009006 is a reply to message #1008990] Thu, 14 February 2013 09:35 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5339
Registered: July 2009
Senior Member
Hi Peter/Bernd,
Yes that's no problem, will add this.

Can you provide me with a diff or exact line number where to call afterConnect? (this to prevent one change-build cycle
if I accidentally choose the wrong location).

gr. Martin

On 02/14/2013 10:05 AM, peter meyer wrote:
> Hello Martin,
>
> we are evaluating Texo for a RCP Client/Tomcat server project.
>
> In the Tomcat Server we run one webapp for CRUD data operations with Texo jsonws, in the same Tomcat we run Birt for
> serverside report generation. Both webapps need authorisation. We want to use the single sign on mechanismen which
> tomcat provide. This mechnismen use session/cookie information and share it between webapps in the same host.
>
> To use this cool feature we must must be able to get and store session information from the HTTP Request in the RCP
> Client and put it in the following requests.
>
> The communication of our RCP Client starts with a JSONEObjectStore.doHTTPRequest.
>
> Would it be possible to provide in the JSONEObjectStore a method
>
> afterConnect(HttpURLConnection con)
> with the established HttpURLConnection as parameter, which is called in the doHTTPRequest method after the connection
> is established?
>
>
> We could override this method (like beforeConnect) and get information from the connection.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1009180 is a reply to message #1009006] Thu, 14 February 2013 15:55 Go to previous messageGo to next message
peter meyer is currently offline peter meyerFriend
Messages: 13
Registered: September 2012
Junior Member
Hello Martin,

please place the afterConnect(conn) method between line 89 and line 90:

89 final OutputStream os = conn.getOutputStream();
89,5 afterConnect(conn);
90 os.write(bytes);


thank you and best regards
Peter/Bernd Wink
Re: [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1009565 is a reply to message #1009180] Fri, 15 February 2013 10:23 Go to previous messageGo to next message
peter meyer is currently offline peter meyerFriend
Messages: 13
Registered: September 2012
Junior Member
Hello Martin,

thank you for your support. I hope that you have not yet implement the afterConnect. method.

This morning i recognized that the line number for the afterConnect method is not correct.
I will do some tests and give you feedback when i know the correct line number.

best regards
Peter
Re: [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1011100 is a reply to message #1009565] Mon, 18 February 2013 21:10 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5339
Registered: July 2009
Senior Member
Hi Peter,
I could not stop myself and added an afterRead method, let me know if that is sufficient (or not ofcourse):
http://git.eclipse.org/c/texo/org.eclipse.emf.texo.git/commit/?id=2a47c29fa295f3f6941b5a169019545ffdbb9a32

gr. Martin

On 02/15/2013 11:23 AM, peter meyer wrote:
> Hello Martin,
>
> thank you for your support. I hope that you have not yet implement the afterConnect. method.
>
> This morning i recognized that the line number for the afterConnect method is not correct.
> I will do some tests and give you feedback when i know the correct line number.
>
> best regards
> Peter


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] provide a method to get cookie/session data from JsonObjectStore.doHTTPRequest() [message #1011300 is a reply to message #1011100] Tue, 19 February 2013 09:13 Go to previous message
peter meyer is currently offline peter meyerFriend
Messages: 13
Registered: September 2012
Junior Member
Hi Martin,

my tests are running well with the new method.

thanks a lot for your support!

kind regards
Peter
Previous Topic:Texo: Auditing feature
Next Topic:[Texo] ArrayIndexOutOfBoundsException
Goto Forum:
  


Current Time: Tue Nov 25 01:59:09 GMT 2014

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

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