original
Many people think that JSP is a successful product of Java to Microsoft ASP challenge. To today, the JSP program has developed TAG / EL and other technologies, and JSP has an idea that JAVA's BS front desk program seems to be unable to reverse. But in my opinion, Java chooses this expression of JSP. It is precisely its most failed place. It is a poor imitation of ASP. It can do better, and it may even make Microsoft completely exit the server. The field, but in the end, it may become a major strategic directional error sufficient to make Java final failure.
Java is still having the advantages of Microsoft all languages today, just in C #, just like it is similar to God. Java's most fundamental place is not that its OOP, which is not that it is C syntax optimization, which is not important, but it's a virtual machine mechanism that makes it the best cross-platform server language; and C # no matter how grammar Similarly, it is unable to change such a reality: it is just a kind of language in Microsoft CLI, it is successful, but also replaces Java running in Windows; some degree, C # is a destined to have no need to exist. Language, in the CLI, only one is enough, like VB.NET.
The biggest impact of Java to the software world is to make the software really developed, and a real three-layer structure. Although some guys boast their software is the N-layer structure (really do not face!), In fact, it is only a variety of varieties of the two-layer structure of the traditional CS. It cannot be called a layer. ! Java reflects software creative thinking, but the biggest place in Java's mistakes is that he has no creatively imitating ASP, and JSP has developed JSP as the main access to the middleware. This is a major mistake. Maybe if one day Java is dead, die in this mistake.
The ASP is the earliest LiveWire's JSP and Cofusion, Livewire is also the JSP that I came to the project in the project, and there is no latter Java JSP. This NetScape company's "JSP" and ASP have a common feature that completely does not have object-oriented features, is a pure parsed scripting language, and later PHP is also such a product, and PHP can be seen as CScript. The emergence of these languages is to meet the ability of those who don't understand the computer language, and from the HTML art, the beauty needs, the United States is known as letting the art can write dynamic webpage levels. However, this development hypothesis is one of the biggest jokes in the Internet. The artist's programmer can't write a real dynamic web page, but let the real programmer do the beauty of the art, the most typical product is Struts.
Java is completely different, it is a language that needs to be compiled, with a complete object-oriented ability; so if it can play this feature, it is no difficulty in defeating the other scripts. As a result, Sun's genius (I think this name is the most objective, both genius, idiot), choosing the tank and Jetta to compete for the taxi market, start JSP. And I think servlet should be its best development direction. Today, I have forgotten what the reason why I gave me to give you JSP and use servlet as a project solution; just remember that the JSP later is due to the two forms, it is very complicated when transmitting variables and addresses, it is not as good as light . Today, when I thought I was wrong, and the appearance of the label / elwiquhek would make JSP to the past, and once again in major projects, (one of the reasons is the continuation of the joke, I hope I don't understand Java maintenance personnel After delivery, you have maintained the system front desk. Another reason is that JSP cannot be maintained based on template. The former is relieved due to the appearance of TAG, (which can also use the include sevlet to reach the approach), the latter is still the same, the key is that the existing code cannot be cleared. In servlet, it is easy to overload a method. Many people think that servlet is difficult to write, there is a number of methods in doget / dopost / init /, etc .; in fact, this is a misunderstanding. This misunderstanding is that the servlet is essentially a Java Class, which can be easily Publicly private methods can also be inherited, overloaded, etc. Therefore, it is easy to form a full system recovery template in servlet, change together. Instead, thinking that writing servlet is output in doget to use Out.println, which is to bring the understanding of the written JSP into the servlet; JSP is compiled into a servlet, it is this like this. So there is no inheritance value.
So how do you achieve the same concise embedding with JSP for complex HTML interfaces? it's actually really easy. My solution is to use $ {xxx} tag preset the default mode, then there is a directory with a file with a large number of HTML code; when the Svert is initialized, it is read through the file byte stream, using a character. The components of string analysis (today are still in use) turn the mark into the corresponding actual dynamic variable. This is precisely today's solution to the most advanced EL expression language. Really, I don't think there is a way to write a servlet is difficult than the general webpage program. To a certain extent, I think I have already made a JSP interpretation engine.
So what is the difference between the JSP and the real JSP of this indifferent? The biggest difference is that it is only the HTML code base for servlet services, rather than servevet serving as a JSP service. In other words, the JSP here is similar to today's Tile / Jspfragment. A small difference, the effect is completely different, because it can complete the characteristics of Java-oriented and inheritance; even like PB, the front desk "inherit" is "inherited", and expands and heavy A place that needs to be modified. And this ability is those "P" language never do it. However, Sun is biased to imitate the JSP in the back of Microsoft butt.
Take a look at what is the most commonly seen in the BS reception? It is a big website. Most of the masks have similar framework layouts, and only some of them are different in each column. JSP can easily share the same parts; but there is no power for the different parts. Since JSP cannot form a top-level template, the content of each of the big columns is different, so the only way is to copy a JSP file for each big column to get a top frame template; obviously, this means the same framework for each file Part is maintained; the larger the project, the greater the workload change in the future. At this time, Hou really missed the function of servlet. For this need, only need to write a servlet, other servlets inherit it, and then overload its central content method, you will get it. The only way to currently achieve similar requirements seem to can only use the IF-ELSE / Equal-Notequal judgment in the top page. Different content files in INCLUDE. Waiting this, is there any good way? The correct idea of Java's BS front desk should be in a servlet that can order inheritance methods, and then you can decompose some files such as JSP. Similar to today's JSP technology can be used in these JSP files. That is, the core should be a customized servlet instead of providing a tool to compile JSP into an unstrenomable servlet. The top file should be a servlet, and it should not be JSP, this is what I said. I can't work with the entire JSP community. It is impossible to complete the work of Sun for thousands of development engineers. Since Sun's genius big stupid chooses JSP as the mainstream of Java's expression in BS, today, if I still use Java as a front interface program, the best is with the largest standard, and in a few years ago, JSP is not the standard, the situation is different. However, from today's actual experience, I still feel strongly, Sun has made a serious methodological mistake. Unfortunately, Sun has nothing to do, so Microsoft is reflected in ASP.NET. Fortunately, Microsoft has never intended to transplant cross-platform, so SUN has a chance.