0

I need a advice for design purpose my structure of the application is as follows. I have three module designed in ZK framework as a separate war application (web application) e.g finance-module , general-ledger and cash-account , all are separate war files can be deploy on tomcat as a separate war files, Now I want to have a seperate war ZK application that has index or home page and have menu and from that menu I can able to call these three module or war application.

-------------------------- Main module -------------

Menu : general-ledger link , cash-account-link ,finance-module

1) This 4th Main module also has feature to user login and change user preference , means can also have code e.g view module as well as spring service.

Now the question is that how to call other war files zul pages and even if v call how to manage from 4th module and also how to share session across the four war files or applications.

Thanks Vikas

vikas
  • 21
  • 2

1 Answers1

0

I have worked in a similar scenario and this worked well for us:

When you create separate war's it means that they are independently running in it's own web context inside tomcat.
Usually when you want to share resources like datasources, transactionManagers, or any other kind of jee resource you need to configure them at the tomcat instance level and they will be available in the JNDI directory of the tomcat server and any web application can pull any of them to use it.
https://tomcat.apache.org/tomcat-8.0-doc/config/context.html https://tomcat.apache.org/tomcat-8.0-doc/jndi-resources-howto.html

There are several jee resources than you can share in the tomcat server but if you need more flexibility and robustness you might need a full stack java enterprise application server like wildfly http://wildfly.org/news/2014/11/20/WildFly82-Final-Released/ or any other commercial like WebSphere, Oracle Weblogic, etc

Now, if you want to share java classes, zul's or any other file, you may want to package them in separate common jars and use them in any war as a dependency and then reference them through the classpath of the web application.To organize and maintenance this modular projects Maven and Gradle are very good tools you can use.

From ZK you can call any other url of the other war's as simple as

<a href="htt://myserver/account/home.zul" label="Account"/>
<a href="htt://myserver/finnance/home.zul" label="Finance"/>

To share the session what you need is to implement a Single Sign On (there are other implementations like oracle opensso), you can configure it directly in tomcat but be aware of this Sharing security context between few web applications .

Spring Securityhas an extraordinary support for this kind of escenario.

Community
  • 1
  • 1
dgofactory
  • 348
  • 5
  • 13