Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts and mvc

 
Arathi Raj
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody tell me what are the uses of using struts over MVC? I know struts is also example of MVC architecture. But I went through HF servlets and JSP. In the 2d chapter it explains that in order to avoid duplicate code in every serlvet , it better to go with Struts. So I didn't understand what kind of duplicate code will be there in every servlet. and using struts what we can avoid.

but as for as i know we can use struts when the application involve too many forms. please correct my knowledge. As am new to mvc and struts.

Thanks
 
Rajesh Vijaya
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raj ,

I 'm also following HF servlets and JSP i do not see anywhere mentioning about struts in 2nd Chapter .....BTW did u look at my previous post ...i'm having problem executing ...if u find any answer let me know...


thanks

Rajesh
 
Ravinder S Edhan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

Regarding duplicate of code... In HF second chapter, it is mentioned that 'you have to move until the end of the book'. And in the end of book a chapter named 'Design Patterns' is there, which help in reducing the code duplication. Some of the design patterns mentioned there are Business Delegate pattern, Service Locator pattern, Transfer Object, Front Controller pattern.

Please go through those patterns to reduce the duplicacy of code

-------------
SCJP 1.4
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually its not about Struts really. Please read about Front Controller Design Pattern. Then you will definitely know that how can we avoid code duplication. Struts is just a web application framework based on MVC architecture. It employs Front Controller design pattern. Some of the other frameworks also employs Front Controller and we can use them as well. We can design our own framework and use Front Controller for a small web application or for practice.
 
Arathi Raj
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clearing my doubts. could u please tell me what is the use of struts. How will it reduce the coding for a developer?

Thanks
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum. Please try to keep questions in this forum to Servlets only.

Thanks

Mark
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should've been moved to struts.apache.org
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic