File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts and mvc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and mvc" Watch "Struts and mvc" New topic

Struts and mvc

Arathi Raj
Ranch Hand

Joined: Nov 22, 2002
Posts: 90

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.

Rajesh Vijaya
Ranch Hand

Joined: Oct 18, 2005
Posts: 48
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...



Rajesh <br /> <br />SCJP1.4 SCWCD1.4 SCBCD 1.3 ,SCDJWS(Preparing..)<br /> <br />There is no free will.It is the phenomenon bound by cause and effect.But there is something behind will which is free---Swami Vivekananda...
Ravinder S Edhan
Ranch Hand

Joined: Dec 15, 2003
Posts: 57
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

Joined: Aug 15, 2004
Posts: 2874
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

Joined: Nov 22, 2002
Posts: 90
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?

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Moving to the Struts forum. Please try to keep questions in this forum to Servlets only.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
should've been moved to

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Struts and mvc
jQuery in Action, 3rd edition