Search code examples
strutsjava-ee-6jboss7.xstruts-1

Multiple Wars on Jboss with a common front end


I am trying an application setup in JBOSS AS 7 and Struts 1.2.8. We have a monstrous project which needs to be broken down into separate deployments so that we can micromanage different modules (i.e. do hot deploy or ONLY deploy the bits that need changes). So there is a Portal - which has several modules inside it - and though the modules share some common functionality like interacting with some (not all) common databases and same ESB in the backend. However functionally all the modules are pretty independent. Hence we want to deploy a Common.war - which will have the Login page and will manage authentication and authorization. Then all other modules will be deployed on their own wars. Any common functionality like communication with Databases and ESB will be pushed to JNDI Datasources and Stateless EJBs. Now say when a user logs in he will go to

  1. https://myportal.com/login - this is hosted and serviced by the Common.war
  2. Once logged in he will be stored in session and redirected to a url https://myportal.com/module1/action1
  3. The 2nd url will be serviced by the war module1.war. Now when this Action tries to access the session and check if the user is the one who logged in - will it be able to access the session for Common.war deployment? Not too sure if a session will be per war or per application server. Any work around if not?
  4. All common back end integration logic will be deployed as EJBs - so I guess that will be accessible by any war. Or is there a better alternative?

Solution

  • You have to introduce session replication and single-sign-on to have the different webapps to share the login (and other) information. I am not sure how you can do it on JBoss, I tried on Glassfish, it worked.

    Maybe this link or that link could be useful.