Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Application Architecture

 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are they on the classpath?
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic