aspose file tools*
The moose likes Servlets and the fly likes mvc 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "mvc 2" Watch "mvc 2" New topic
Author

mvc 2

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Without struts Framework,Can we implement MVC2 with normal JSP,Servlet?
Katrina Owen
Sheriff

Joined: Nov 03, 2006
Posts: 1347
    
  13
The short answer is "yes". You don't need to implement a framework in order to use the model-view-controller approach.

Here is an article written by one of the staff members about MVC:
http://faq.javaranch.com/java/Model1Model2MVC

My understanding is that you can create the 'model' in the form of Beans or regular (if there is such a thing) Java objects, put the View in your .jsp, then use the Servlet to orchestrate the whole thing, passing calls to the model, the model returns information, and that information can in turn be passed to the view.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

Of course. Frameworks like Struts and Spring and all the others (including my own Frontman) are all written using the normal JSP and Servlet mechanisms.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

P.S. There's no mvc 1 or 2, It's just MVC. You may be thinking of Model 2.
 
Consider Paul's rocket mass heater.
 
subject: mvc 2