• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why use struts?

 
Preet Dholabhai
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay. thank you.
 
Nidhi Garg
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay.
this helped me get a better idea than your previous post. i shall read its user guide.
thank you .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic