Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of Struts and tag lib

 
Jasmine kaur
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,
Well my question is this when we have servlet and we have jsp then why then we use complicated tag-library and struts concept have been desigend ,when we can achieve the same thing from our jsp and servlets , why we are making the things so compicated when we can achieve the things simply.
Thanks
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that tag libraries can do things simply. It also make the code more readable.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use Taglib/Custom Tag in JSP,

1. Readability
2. Rapid development if you have completed taglib.
3. Easy to debug code/maintain code
 
lesley evensen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To respond to the original question (why use the Apache "Struts" framework), when you have tag libraries allowing you to build pages integrated with Java beans, sql (and less javascript!): you shouldn't necessarily use Struts. The overhead may not be worthwhile if you are only building a small app (small is relative, but if you have only a half-dozen classes or so to deal with that may be a measure of 'small', and only a few pages). If you have MANY pages, Struts can help organize control flow, which is a big issue. If you don't want to write a large controller yourself, Struts provides that framework
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic