This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See web archive that just handles the user signup and login. That way I could work on my other web archive apps independently and have them just check to see if the user has logged in and posted a token somewhere, and if not redirect to the login webpage.

Is there a way to do this?

Posts: 3648
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK so you plan to have a WAR (web archive) just for login and registration. Then other WAR files doing other stuff.

Yes this is indeed possible. Create a EAR file (enterprise archive) and add all the relevant WAR files in it). Set the entry point URL to the login/reg WAR file.

Now once logged in, you will need to redirect to a new web archive's files (one of those other WARs). Similarly when user logs out redirect it back to the login page.

Thinking about it, will this mean you need a separate archive for logout only or each other WAR has a logout?

Also I really don't know how sessions are maintained from WAR to WAR.
Posts: 42975
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds exactly like what SSO (single sign-on) is for. You may wish to check out the existing solutions in this space - see for a list of some of them.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!