• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

nested webapps in tomcat?

brikis98

Diamond Member
Currently, we have the following webapp:

webapp1/
--META-INF/
--WEB-INF/
----web.xml
----lib/

This webapp is very simple, has no front end, a very basic web.xml, and executes lots of code within the jar files in WEB-INF/lib.

We have developed a separate webapp that does have a front end, uses struts, tons of tag libraries, etc and looks like:

webapp2/
--images/
--jsp
--script
--style
--META-INF/
--WEB-INF/
----web.xml
----struts-config.xml
----a ton of tld's
----lib/

The issue we ran into is that webapp1 now needs to initialize, launch and interact with webapp2. However, because webapp2 has a very different configuration and should be somewhat modular, we don't want to just combine the two.

question: is it possible, in tomcat 5.5, to make the following directory structure work:

webapp1/
--META-INF/
--WEB-INF/
----web.xml
----lib/
----webapp2/
------images/
------jsp
------script
------style
------META-INF/
------WEB-INF/
--------web.xml
--------struts-config.xml
--------a ton of tld's
--------lib/

that is, webapp2 is contained within the WEB-INF folder of webapp1 but each webapp still has its own web.xml, WEB-INF/, META-INF, etc.
 
No, that is not possible. Each web app must be self-contained.

What level of interaction do you need between webapp1 and webapp2?
 
I believe there's a way in tomcat to allow apps to interact with one another, although for a life of me I can't remember how. You may need to look up tomcat documentation.

That being said, I would recommend against that, since it goes against everything in J2EE spec. Did you consider having APP 1 expose the needed functionality through web services?
 
Originally posted by: MrChad
No, that is not possible. Each web app must be self-contained.

What level of interaction do you need between webapp1 and webapp2?

that's a shame... there's no way to do it, not even using struts?

we have a relatively large amount of interaction between the webapps... webapp1 starts and stops many parts of webapp2 and they need to share a number of objects between them.

i've read online of ways to share data between webapps, but so far, none of them look like "clean" and "safe" approaches, so I think we'd rather avoid them. in the absolute worst case, we'll collapse the two webapps together, but if any1 has other suggestions, please share them!
 
Back
Top