Criticism looks like a feasible representation: JavaServerPages Servlet technology (on)

zhaozj2021-02-08  379

JSP technology - is a friend or an enemy?

Criticism looks like a feasible expression technology: JavaServerPages Servlet technology

Brett McLaghlin

Lutris Technologies

ENHYDRA Strategist

October 2000

As a Java technology veteran and new

ENHYDRA supporter, the author force advises developers who consider other methods other than JavaServerPages (JSP) servlet when choosing a WEB application. JSP technology is part of Sun's J2EE platform and programming model, which is to solve the problem of how to make a monotonous content into a distinguished representation layer. In fact, Web developers are not unanimously satisfied with JSP technology. Since multiple variants of Sun technology can now be used, you can choose between many representations. This paper explores the JSP coding technology and explores several attractive alternatives.

The technical design is used to convert the plain Latin original web content into content in the attractive representation. JavaServer Pages (JSP) technology, as part of Sun company and part of J2EE platform, has been greatly concerned. It is advantageous to use JSP technology. Web developers should know these pros and cons. They don't have to stick to this technology. In fact, many representations have recently emerged. This article is based on the problem to be solved by the technology, and then examine the unique advantages and weaknesses of the JSP model. Finally, several feasible programs that can replace SUN indications.

Historical grades preceding the detailed background information generated by this technology in a deep interpretation of the technique. Just 10 years ago, the thin client is still a very new term. At that time, we lived in the world of desktop applications, using low-level 286 microprocessors, squinted 14 inches of monitors. But now the time is different, friends! Now, my desktop does not do anything else to run a web browser. We use Sun, IBM, HP, Compaq, and other company's servers to run computing, business logic, and content. That small display? It has been replaced by a large and beautiful 21 inches and 25-inch plasma flat displays. why? Because so we can watch the intricate HTML display, and these HTML display is the front end of powerful applications. The single-tuning interface is no longer able to meet the requirements; now, we want to see gorgeous graphics, moving images, color coordination, no matter which room seems so beautiful, and can be quickly displayed.

Today, ten years later, the Windows application as a prototype has become a history, and we are still facing a huge shift in the method. Tragic Visual Basic and C programmers have found that they can only write a backend system or only for Windows applications, or have added language that provides web feature in their own toolbox, such as Java languages. If you do not support more than three-quarters of ML language (such as HTML, XML, and WML) applications, even if it is not considered to be completely failed, it will be considered very bad. Of course, this shows that we all pay attention to the ability to develop the Web representation layer.

As a result, use new Internet and all our familiar languages ​​(Java, C, Perl, Pascal, ADA, and other languages) are not as easy as we want. There is a lot of problems when the programming language used for each person is used for backend programs and generates a markup that applies to the client. As the browser provides more options (such as DHTML and JavaScript encoding), the increase in the Web field graphics art talents, and the emergence of tools that can use standard HTML to generate complex interfaces, demand for unique user interfaces is better than we develop these applications. The ability to grow in front of the program is still fast. This leads to the rise of technology. Represents technology design to perform a task: convert content (ie, data without displaying details) to representations - you can see all user interfaces you can see in your phone, handheld, or web browser. These representations can solve what problems can I solve? Let's take a look.

The most basic purpose of isolation and integrated representation is to make the content and representation can be separated. In other words, business logic units (possibly written in C or Java language) do not have to generate code to represent specific ways. Data or content is returned in the original form without any format. Thereafter, the technique is shown to add formats or representations for these contents. As a result, the data is surrounded by graphics, format, color, and logo.

Look at the examples in Listing 1 and Listing 2, look at the original content and the difference between the contents of the technique.

Listing 1 shows the original content, in addition to the data, no other things, can be used in a variety of ways.

Listing 1. Only the original content of the data

Russell Crowetom Hanksmeg Ryanmary Stuart Mastersonalec Baldwinashley Juddkeanu Reeves

Listing 2 is more complicated than the previous list, which shows the same data, but these data packages are shown in the representation technique and can be displayed in a browser that supports HTML.

Listing 2. Data indicating packaging

Search Results: Actor </ Title> </ head> <body> <h2 align = "center"> Search Results: actor </ h2> <center> <hr width = "85% <Table Width = "50%" cellpadding = "3" cellspacing = "3" border = "1" bgcolor = "# fffccc"> <tr bgcolor = "# ffcccc"> <th width = "50%" align = "center"> name </ th> <trh width = "50%" align = "center"> name </ tH> </ tr> <tr> <td width = "50%> BALDWIN </ TD> <TD Width = "50%> ALEC </ TD> </ Tr> <Tr> <TD Width =" 50%> CROWE </ TD> <TD Width = "50%> RUSSELL </ TD> < / TR> <Tr> <TD Width = "50%"> Hanks </ TD> <TD Width = "50%> TOM </ TD> </ TR> <TD Width =" 50% "> Judd </ td> <td width = "50%> Ashley </ td> </ tr> <tr> <td width =" 50%> Masterson </ TD> <TD Width = "50%> Mary Stuart </ td> </ tr> <tr> <td width = "50%> Reeves </ TD> <TD Width =" 50%> Keanu </ TD> </ TR> <Tr> <TD Width = "50%"> ryan </ td> <td width = "50%"> meg </ td> </ tr> </ table> </ center> </ body> </ html> inventory 1 For those who have no experience, it is easy to understand and it is easy to use. The contents in Listing 2 are dedicated to display in the browser. Extract data from Listing 2, or handle it for other purposes, you need to have some techniques.</p> <p>This basic difference - the process of separating the representation and content rather than integrated (at least when the user does not need this information), it is a premise that the technique (including JSP technology). Further, it does not achieve this basic goal, there is no initial purpose of designing.</p> <p>Preparation and Modification In addition to separating content and representation, it is a modified workload that is exempted by the other factor that indicates whether the technology is useful. Indicates the separation of the content to increase the difference between the character developer's role. The programmer can focus on the original content in the previous example, graphics artists or website administrators can put their energy on the representation. However, some role overlaps in the contents of the artist design or marker and join the programmer-based content.</p> <p>In the simplest case, the artist provides tags, developers to provide code and insert the tag insertion representation. Then, the application "start", the content will become a user interface. Of course, we all know that development work will usually not only end. The next step is to revise and change the interface, and prepare new business rules, which is the place to test the flexibility of technology. Although the raw data in which the update input to the representation is usually not difficult, the graphic artist is difficult to edit their original work. It is common to change the change of the layer (we all have been changing this change). So, now there is such a problem: What should the designers start to change their work? Is it a modified original markup language that they handed over to developers? maybe not. Because the most likely, this page is likely to be inserted into custom tags or code (JSP pages, template engines), which are converted to Java servlet, or have become unrecognizable.</p> <p>Typically, designers must modify them on the original page and give this page to developers again. Developers must turn this page again into representing the specific format used in technology. Otherwise, the designer must learn a scripting language, or at least know which source area in this page is forbidden. Of course, this is an easily error, very dangerous approach. Once you are determined to explicitly separated between technical support content and representation, you should ensure that the change indicates the required modification workload is minimized.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-470.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="470" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.039</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '_2FjgPacj2hrFRhPW_2Bda02ryGI0UCMBiYojgxwc41Uik2VTVX6D2myjrthsGh7nmv2T_2F4LOMZEVKbN05B9'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>