aspose file tools*
The moose likes Servlets and the fly likes folder directory for sub domain web desige Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "folder directory for sub domain web desige" Watch "folder directory for sub domain web desige" New topic
Author

folder directory for sub domain web desige

David Nelson
Greenhorn

Joined: Nov 13, 2003
Posts: 22
how to mapping my folder directory structure to sub domain.

e.g. www.mywebsite.com has several sub domains: photo.mywebsite.com, club.mywebsite.com, music.mywebsite.com, ... do i need to create corresponding directory when i developing? what directory structure should i have.

these subdomain still share the same resources, such as database connection..

Cheers.

David
John Smith
Ranch Hand

Joined: Sep 02, 2004
Posts: 61
Obviousy this is a super open ended question but I would suggest:

WEB-INF/club
WEB-INF/music
WEB-INF/photo
WEB-INF/common

Write yourself a class that has an instance of a database connection as a private member variable and stick it in the common, when you need to use the database from anywhere just grab that instance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Just creating folders, especially ones hidden behind WEB-INF isn't going to do a thing for you in this respect. You need to configure your sub-domains at the server and the servlet container level.

I can't help you with the server setup, but once you have the sub-domains configured, look into the concept of "virtual hosts". In Tomcat, you would configure these in server.xml using the <Host> elements.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Nelson
Greenhorn

Joined: Nov 13, 2003
Posts: 22
Thanks so much for your reply, need to try it ;-)
 
 
subject: folder directory for sub domain web desige