nikhilgupta86
nikhilgupta86

Reputation: 492

What is best practice to call any other servlet in other JVM from some other JVM

i was going through the difference between servlet context and servlet config and there is one question that came to my mind that suppose if one of my servlet in JVM1 want to call any other servlet in JVM2 than how could we do it. Say i am login into one appliaction in JVM1's web server and in between it want to access another apllication in some other JVM2's web server and i do not want user to pop for login again than what could be the best solution for this. Someone told me load balancing clustering is one solution.

Upvotes: 1

Views: 78

Answers (1)

RRM
RRM

Reputation: 2669

If you want authentication as well as authorization details to be shared in your setup across two JVMs, then you might want to implement SSO (Single Sign-On).

One good link for SSO:

http://docs.oracle.com/cd/E19396-01/817-7649/prog_sso.html

If there is no co-ordination between the 2 different Servlet containers in different JVMs, then they are completely independent web apps.

Otherwise, as non-standard solutions, if both the JVMs share a file system/RDBMS or any other secure persistent systems, you could persist common auth details in encrypted form and let Servlet containers access the common datasource specifically for sharing auth details.

Upvotes: 2

Related Questions