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

mvc artitecture  RSS feed

 
Sweety S.
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i amm working on developing website i amm working on jsp now a heard about mvc artiecture how can i apply mvc in my project?
pl. reply
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We really will need to know more about your project, if you want us to help.
What services or user actions do you want to provide? What information do you want to show? Where will you store persistent information? Will your web application be the only way of changing your stored data? etc...
The more you can tell us about your requirements and the decisions you have already made, the more we can help.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sweety,
In Web application, in general, we will have 3 components: view, model and controller.
Basically, JSPs represent view, which is for displaying results or information. Servlets represent controller, which means all requests are received by the Servlets, and the Servlets decide what to do: making a call to DB to get data, or on receiving data, send the data to the corresponding views for displaying. Model is the data.
In general, for any client requests, the Servlet will capture it, decode (or identify) it, and decide what to do. For example, if the request is to list the fast food shop locations in US, the Servlet may then generate a SQL statement, send to the DB via JDBC driver, execute it and get back the result. The result will be the Model. And there is a specific JSP that is used to display the result from the Model.
Does this clear your doubt?
Nick.
 
Bill Dudney
Author
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Struts would be another great place to get started understanding the MVC pattern as it relates to web apps.
Hope this helps!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!