File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Web Application Architecture 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 » JSP
Bookmark "Web Application Architecture" Watch "Web Application Architecture" New topic
Author

Web Application Architecture

Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
This is what I have designed. experts' input/feedback??


Where the stuff like Jsps,Images and JavaScript would go? Under WEB-INF?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Why do all the packages not start with com.companyname.projectname?

Vishal Pandya wrote:Where the stuff like Jsps,Images and JavaScript would go? Under WEB-INF?


If your app is properly structured such that all requests go through servlet controllers, the under WEB-INF is a great place for the JSPs. That ensures that they cannot be directly addressed.

Images and JavaScript on the other hand, must be addressable by URL and cannot go under WEB-INF.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Bear Bibeault wrote:Why do all the packages not start with com.companyname.projectname?

Do you mean resources should also be start with com.companyname.projectname?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Are they on the classpath?
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Bear Bibeault wrote:Are they on the classpath?

Doesn't the whole source directory go to classpath? I didn't get you?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

Vishal Pandya wrote:
Bear Bibeault wrote:Are they on the classpath?

Doesn't the whole source directory go to classpath?

No, sources shouldn't even be part of the web app. The class files (along with the properties files) go on the classpath.

But with regards to the resources... The purpose of the package structure is to prevent naming collisions. By prefixing the packages with com.whatever.thisnthat you prevent collisions. What is preventing collisions for your resources?
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
No, sources shouldn't even be part of the web app. The class files (along with the properties files) go on the classpath.

Yeah, I mean to convey that only. The whole resources package would be on classpath.
What is preventing collisions for your resources?

Ok, I got your point. So resources too start with com.whatever.thisandthat.
The purpose of the package structure is to prevent naming collisions.
Indeed.

Everything else is ok?
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Thanks Bear!
 
wood burning stoves
 
subject: Web Application Architecture
 
Similar Threads
Spring Web services
Where in Tomcat3.1 should i put .jsp files, .java files(Beans files)
What else is Spring good for?
Two WARs in one EAR
Exposing existing service layer classes as web services