This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Organising Tomcat for different projects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Organising Tomcat for different projects" Watch "Organising Tomcat for different projects" New topic
Author

Organising Tomcat for different projects

Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
Hi guys,

I just wanted to know how I could organise my projects in such a way that I can have multiple projects on Tomcat running, with different databases/sources at the same time.

As it stands I have all my JSP's etc organised in ....Tomcat 5.5\webapps\ROOT\JSP\...

How should I go about changing my approach so I have neatly organised projects?

Thanks in advance.
Regards
Zein
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41630
    
  55
That sounds like a perfect use of the concept of web applications. Am I missing something?


Ping & DNS - my free Android networking tools app
Zein Nunna
Ranch Hand

Joined: Mar 31, 2005
Posts: 245
See Ulf what I was thinking along the lines of ,

....Tomcat 5.5\webapps\ROOT\Proj1\JSP\...

....Tomcat 5.5\webapps\ROOT\Proj2\JSP\...

....Tomcat 5.5\webapps\ROOT\Proj3\JSP\...

Do I just copy the WEB-INF folder for each project from the original folder??

Also for each project I will be having seperate data sources, which I understand I need to 'register' in the server.xml file, would this allow me to have more than one data source?

Thanks in advance
Regards
Zein
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41630
    
  55
Don't put anything into ROOT - it is its own web application that you should not alter. Create a directory layout like:

....Tomcat 5.5\webapps\Proj1\JSP\...

....Tomcat 5.5\webapps\Proj2\JSP\...

....Tomcat 5.5\webapps\Proj3\JSP\...

Each of these would have their own WEB-INF directory with their own web.xml file.

You can have any number of data sources; just make sure to give them different names.
[ February 15, 2007: Message edited by: Ulf Dittmer ]
 
 
subject: Organising Tomcat for different projects