This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Different Web app structural views Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Different Web app structural views" Watch "Different Web app structural views" New topic
Author

Different Web app structural views

shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 147
Generally after developing a dynamic web project in eclipse we get the application structure as "src" "webcontent".
But there is another structure of web applications. Can anyone provide me an insight as to how that structure
of a web application is achieved.
Images in the attachments.




[Web_layoutOne.png]


[Web_layoutTwo.png]


[Web_layoutThree.png]

Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

I strongly advise you to follow the Standard Directory Structure (-link) as proposed by Apache in their maven project. Although it was initially introduced for the maven projects , but I have seen a lot of people follow it because of its standardized and easy to follow directory hierarchy.


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
shivang sarawagi
Ranch Hand

Joined: Jun 19, 2008
Posts: 147
Thanks for the reply. So if I build by project with maven I will get the same directory structure?
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

shivang sarawagi wrote:Thanks for the reply. So if I build by project with maven I will get the same directory structure?


You have two choices, either make changes in your current directory structure to the standard directory structure , or (if you want to use maven as your build tool ) make use of the Maven archetypes. These archetypes are basically skeleton project structures that can be downloaded are ready to use . You will see that the whole of the directory structure is already set up in these archetypes.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Saif Asif wrote:You have two choices,

There are way more than two choices. I don't use either of eclipse or maven, so my organization is very different from any of those.

What it comes down to is that, outside of WEB-INF, the organization is up to the developer and the tools being used. Some IDEs require a specific structure, as do some frameworks.

The organization within WEB-INF, of course, is dictated by the servlet spec.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Bear wrote: I don't use either of eclipse or maven, so my organization is very different from any of those.


What organization do you use Bear ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

It really depends upon the purpose of the application and what tools I am using. For example, for projects where I use the Play! framework, the structure is dictated by the framework.
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

I see . And its far better to use the structure defined by the framework rather than to configure and use an entirely different structure.
 
Don't get me started about those stupid light bulbs.
 
subject: Different Web app structural views
 
Similar Threads
why web application is structured
Simple JSP problem !!
Validating username password giving blank page
Can an application read the resources outside of its own directory structure?
wierd JSF problem - URL changing