This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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..
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.