I was looking for advise as to when do people generally go about creating a new web application on a Tomcat server as opposed to using an existing one.
I have a web application that is deployed and running. The website that you see by typing the domain name is mostly a static page website with very few dynamic pages that I have built with struts2.
When a user goes into the Member Area and logs in, that is when the user will get a lot of member related stuff, which is all dynamic jsp pages.
The question is should I be putting the member area pages and server code into a new webapp or just build on the existing webapp. If I create a new web application, does that make it more flexible as such?
Two web apps, even deployed on the same server, don’t share the same classloader and the same sessions. So if you think that the two sets of page are the same app, from a functional point of view, and if you want the session to be shared between both sets of pages (just to be able, for example, to display a “Hello John” in all the pages once the user is authenticated) then they should be in the same webapp.
If, on the contrary, you want a different authentication for both sets of pages, and they don’t have anything in common from a functional point of view, then make two webapps.
Based on what you said in your question, I think everything should be in the same webapp. Don’t use two webapps for purely technical considerations, like “these pages are static and these aren’t”.