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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56205
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
David Nelson
Greenhorn

Joined: Nov 13, 2003
Posts: 22
Thanks so much for your reply, need to try it ;-)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: folder directory for sub domain web desige
 
Similar Threads
Drupal clean url issue
Tomcat based redirection
Drupal clean url issue
Tomcat - Where to put servlets
Best way to reference external files through my webapp