Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Folder Structure  RSS feed

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How should be the folder structure of a simple j2ee application.

My folder strucre is as follows

[ March 07, 2007: Message edited by: Jigar Naik ]
[BSouther: Added UBB CODE tags]

[ March 07, 2007: Message edited by: Ben Souther ]
[ March 07, 2007: Message edited by: Bear Bibeault ]
 
Ravinder Rana
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through this link: Directory Structure
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See Section SRV.9.5 in the servlet spec.
There is a link to the spec download page in my signature.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ravinder Rana:
Go through this link: Directory Structure


For a simple servlet application, the chart on that page is a bit 'overkill'.
It also doesn't show a classes directory under WEB-INF.

I think the best way to start is to read the SRV.9.5 and keep things as simple as possible.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot guys....
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have gone through, SRV 9.5 and they have give something like bellow



does this means all jsp and html file will be in a root directory together ???

and What about all my source files ??? Controller.java and and other java files ??? What about src folder ???
[ March 07, 2007: Message edited by: Jigar Naik ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add as many sub directories as you like to the root of the app.

In an MVC app, it is preferable to place your JSPs somewhere under WEB-INF to prevent direct access to the web.

Your source code is not part of the application, so put it where you like.
However, there are some containers that will auto-compile your source for you. I think Resin has this feature. In a case such as this, check with the container's documentation to see where it expects the source files to be.
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, as you said i have created one folder (jsp) in WEB-INF folder

that is my view.jsp will be as follows



and in my Test.war file



but now how will i access my view.jsp file ???
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may create passthrough.jsp and place it in root. Use URL like:
http://mysite/contextofmyapp/passthrough.jsp?mytarget.jsp
This jsp should just forward to jsps under WEB-INF/... I think.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, you should be using a proper front controller. Perhaps this article might be helpful.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!