aspose file tools
The moose likes JSP and the fly likes Web Application Architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply 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: 56554
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56554
    
  14

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: 56554
    
  14

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!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Web Application Architecture
 
Similar Threads
Spring Web services
Two WARs in one EAR
Exposing existing service layer classes as web services
What else is Spring good for?
Where in Tomcat3.1 should i put .jsp files, .java files(Beans files)