• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP -> Model or View or Controller

 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While following MVC architecture
Servlets acts as Controller which accepts requests and give response
Model is backgroung Beans Database Classes an Database
and View is HTML, DHTML, JAVASCRIPT

Where we could place JSP between these three??
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65520
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
View, of course. Unless you're doing it wrong...
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it View or View-controller as we use JSP as controller too.
Or we can say View - Model?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65520
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Azrael Noor wrote:as we use JSP as controller too.

Like I said, unless you are doing it wrong.
Or we can say View - Model?

If you've got model in your JSPs, not only are you doing it wrong, you're doing it very very wrong!
 
leo donahue
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it View or View-controller as we use JSP as controller too.

Azrael,

Think about this for a minute.

Controller - What does it do? Gets the user request and provides page navigation based on an outcome from the model.

Model - What does it do? validation, accessing a database, storing values in Bean properties, providing response value to controller.

View - What does it do? Present data. If you use JSP for this, you shouldn't need to use much logic here if any, just output elements.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!