Search the Community
Showing results for tags 'framework'.
Found 1 result
-
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.