The MVC mode provides the principle of standard expression layer and business layer logic separation module, but the MVC is implemented in the JSP to face stateless environments, while status maintenance is the topic of the MVC mode implementation. Therefore, maintaining the status of the MVC becomes one of the biggest puzzles and cost constitution factors when implementing MVC / JSP, and its disadvantages are revealed in the Struts project. The difficulty of state maintenance is ultimately manifested in multi-step control parameter maintenance, OpFlow provides a way to face the process object to maintain maintenance, but as the JSP tag appears, the JSP MVC may be more suitable for label Implementation, further retrieving the entire JSP / MVC implementation method, but may also be a progress.
Opflow is essentially designed to implement MVC control flow in a web application. Whether you should use MVC mode in web applications, there is still a big dispute in the technical community; and some typical frames, like .Net and Java Struts are not as good as in actual applications. It is often a loss. MVC basically reaches the layers in the module problem in the web application, the V view part is distinguished from the business and underlying logic, this is no more controversial; the focus is C, How to define C? How to safely use the C controller safely without strict state reservations? In the MVC mode, if each of the controllers, it is only actions for each servlet.action.do, which is only actions to a destination object (like a order record), then the actual significance of the MVC is lost. It is also a compromised method in the next grade model, but it is not a correct way, because, it is not possible to use the MVC to provide software development and operation efficiency. Therefore, in the actual operation, use some passed parameters, like "ACT" tells the controller type, and performs different controls by changing different parameters to reuse the maximum efficiency of code function; this is not necessarily the maximum functionality In combination, what is the right to reuse, I think it takes fine tuning in the actual work.
The same logic also exists on the V view. If developers want their own view part becomes a display frame (Microsoft Word, even the browser is a display frame), rather than every detail of each display object must be a program, must also be based Different instruction parameters extract different content to reuse the maximum efficiency and the lowest cost module. In this way, whether C is also V, if you do not want to make your own development into a randomly extendable number of factors, it will face another difficulty: handling a series of ACT parameters. These parameters are generally passed in the Request.Parameter. In the discussion with some version of the friends, some friends will confuse the namespace stored in the parameters. I think the session is generally used for the parameters of session tracking, and should not be associated with the interface; and Application should be a public variable of the whole system; PageContext should only end with the current page; if this name is not clear, it will put the trap of the self-imported parameters.
Since the web application does not exist like a single runtime status of VC / VB / JavaSwing, it is roughly only two ways when multi-step operations must be shared, and only two ways: First, establish an operational context-oriented context in the session ( Object) Helper, the other is to maintain multi-step state variable consistency during the request process. The former is more general way, but the disadvantage is also obvious, that is, every operation should consider a helper, then use vector, arraylist but set type variables; Obviously, the FORMBEAN and DYNAFORMBEAN in Struts are like this. Helper. The latter If there is no tool help, it is simply a nightmare to maintain variable consistency in multi-step operation. OPLFOW is a tool. Hanva.opflow imagine that using an external XML file, see the operation of the interface as an object, defined as a flow, each step, the URL corresponding to the Flow is considered a Flow, by judging STEP The variables of each environment are organized in an agreed manner, including logical conversion of variables, and deteta will be reversed in the garbage collection station. With its help, you can easily make different pages into one step to automatically maintain the Web functional module. Imagine reasonable, the implementation is also very ideal, but after a period of operation, there is still a deficiency.
First, the XML modification must restart the application to reload memory; second, for page people, "
The JSP tag provides a way to resolve this contradiction, and it has been extracted in the previous article, the JSP tag can be seen as a servlet that configures variables in the RVLET in JSP, which can be implemented by the controler implemented by servlet It can be done by the JSP tag, and it can access the JSP context space compared to the servlet, enabling the same logic to access the PMI control with the JSP. This is why I decided to gradually turn ServletController to label Controller, although the label still does not solve the drawback of JSP to maintain the top-level template. However, this affects the key C key C key in the MVC, and in fact, the same technical method (label) using the same technique (label) is implemented as a uniform medium, and it must also affect OpFlow. In this way, the entire project of my component JSPWeb application has changed, although it is probably progress, but the maturity of the model always requires some of the balances, and its advantages and disadvantages must actually experience during use. come out. It turned out that the use of the JSP controller label would greatly reduce the necessity of opflow, because one of OPFlow is to make up for the servlet, which cannot be easily adjusted; the JSP page that calls the controller tag itself can also be adjusted as parameter adjustment Space, this is the need for Opflow reduced? However, when actual use, it is found that Opflow is still necessary, unless the underlying code of the original maintenance parameter is integrated in the label, because with the label use, the number of JSP increases It is no longer too much maintenance, which is actually only one or two labels. As for how to use it together, it is also necessary to slowly summarize in the application, and it is worthy of a reliable and efficient program model to work from the previous work.
Http://zwwwxy.blogchina.com/blog/Article_81038.1391946.html
From the current situation, the operation tag is a replacement of the servlet controller rather than replacement of Opflow. The label itself cannot simply achieve low-cost parameter maintenance; however, this is unintentionally found in unintentional, due to ActionTag It is used as the same steering code as Struts.ActionServelt, I added a part from the Header to take the referer as a steering target; in this way, the single step operation is back in operation after operation. The display page of the same conditional parameters - Obviously, write the label directly on these pages to achieve the same effect. However, it is necessary to judge the label before the label takes effect before the label calibration service operation.