Jump to content
xisto Community
Sign in to follow this  

Struts: Is It A Technology Or A Framework

Recommended Posts

Though I am a beginner in struts but I am putting here my understanding of struts.Struts is a framework and not a technology.The reason why struts is a framework is it isn't bringing any new component. Its basically providing a new framework to handle Projects following MVC framework.Before understanding struts its necessary that you get yourself well acquainted with MVC framework- the model ,view and controller framework.Controller intercepts every user request and sends it to middle tier for further processing, View displays user input and also error pages if for certain reasons a request can't be fulfilled and Model deals with back end i.e database. In a big project if there isn't a clear separation between these 3 categories any modification made to any one of these categories in the future after completion of project or amidst project work can't be done without navigating through the whole project and this is undesirable. Now struts mainly focuses on Controller.All of the core components in it belong to Controller category. A controller mainly provides centralization of logic.If logic for deciding which page to navigate next(like if we go to page A there appears 2 hyperlinks one leading to page B and another to page C.Depending on which page we clicked it either leads us to B or C) is being determined in the present page then the project is truly decentralized and is hard to manage. Now if we centralize our project by using a servlet the following situation happens:

If in a medium scale application if say suppose there are 15 JSP pages and each page has again 5 links.Then all total we have got 15*5=75 pages.Now for these 75 pages 75 if blocks will be needed in the doget() method of the Controller class. So now the Controller has turned up to become a really Fat Controller. This fat controller is being replaced with ActionServlet and struts-config.xml.Now within this struts-config.xml one can specify which page will come after a form is submitted or if an error happens which page will be displayed all using just tags.So the bulky code is being replaced with tags in xml and at the same time centralization is achieved as now if one wants to change the user registration page only you have to change the name under the <form-bean> tag.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.