aspose file tools*
The moose likes Struts and the fly likes why use struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "why use struts?" Watch "why use struts?" New topic
Author

why use struts?

Preet Dholabhai
Greenhorn

Joined: Jan 24, 2010
Posts: 19
hello everyone,

why do we use struts framework?
i mean we can apply MVC architecture to our application without using struts also, where jsp is the view and servlet act as a controller and model.

thank you.


Thanks & regards,
Preet
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61772
    
  67

Who is "we"?

You make it sound like everyone uses Struts. We don't.

People use Struts if they find it is useful for them, or if they have been told to do so. Others, don't use it if they don't find it useful, or have been told to use something else. Simple as that.

There are lots of choices, including not using a framework at all.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
I basically agree with Bear. This is not much of an argument, though:
i mean we can apply MVC architecture to our application without using struts also

Along those lines you could ask "Why use Java? What's it do that can't be done using Assembler?" If you ponder that question, you'll get closer to answering the question of why one might use any framework.
Preet Dholabhai
Greenhorn

Joined: Jan 24, 2010
Posts: 19
okay. thank you.
Nidhi Garg
Greenhorn

Joined: Jun 19, 2009
Posts: 21
By using some framework it becomes easy to implement things. for example for writing html code if you do via struts , there are library predefined for that purpose.
so it becomes easy to write the code. Its much more maintainable too.
Preet Dholabhai
Greenhorn

Joined: Jan 24, 2010
Posts: 19
we can write html code faster in any IDE. it is just drag and drop...
if you could pl. elaborate when you say " pre-defined libraries for writing html code makes it easy to implement it".

and maintainability would automatically come if i am using MVC which i can do by using jsp and servlets also(as i mentioned in my first post) so it again comes to the same point why struts?

i went through many sites searching for the answer but i think its only because of the MVC implementation and the answers i got from Ulf and Bear also signifies the same(pl. correct me if i interpreted it wrong ) .
So i think it depends upon an individual what to use and what not to. personally, i think struts make it easier to implement MVC.

Thank you.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
pre-defined libraries for writing html code makes it easy to implement it

Struts uses JSP for the templating mechanism, so one would rarely write HTML, but JSP. Struts has JSP tags that are used to implement forms (and a few other things), but that's true of most Java web frameworks, so it's not a distinguishing characteristic of Struts.

maintainability would automatically come if i am using MVC

Maintainable code is about much more than using MVC, and no framework can help you if the code you write doesn't follow good practices.

i went through many sites searching for the answer but i think its only because of the MVC implementation

Struts does much more than MVC, as do almost all other Java web frameworks, and its user guide will tell you what all those things are. Be aware that Struts 1 is dead for all practical purposes; new projects should not use it. And Struts 2 is different in an incompatible way, and thus very unlikely to be used as widely as Struts 1, since today there are many more frameworks available than there were when Struts 1 became popular.
Preet Dholabhai
Greenhorn

Joined: Jan 24, 2010
Posts: 19
okay.
this helped me get a better idea than your previous post. i shall read its user guide.
thank you .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why use struts?