Analysis on single processing and multi-task processing of JSP Technology

Source: Internet
Author: User
Tags wysiwyg html editor

JSP technical ticket handling and multi-task processing

As mentioned above, ideally, designers should be able to perform separate processing, focusing only on graphic design, and developers should be able to focus on programming. Therefore, the designer can process the page after converting it into a format suitable for the application. To convert a JSP page to a suitable application format, you can point to the page to import JavaBeans, insert inline encoding, and add a custom tag library. The problem is that some designers use HTML editors, such as HoTMetaL, Macromedia Dreamweaver, or FrontPage, which cannot identify code scriptlets or tag libraries, which means that the designer actually only receives part of the page. Imagine how troublesome it is to mark the library or code snippet to generate only several rows of the table or other formatting details on the page. The designer uses an incompatible HTML editor and cannot see the appearance of these elements. After developers complete coding, designers cannot easily modify the page. In this case, not only are roles not clearly divided, but JSP encoding actually combines these two roles into one: A developer must perform multiple tasks and assume the developer, designer, and other roles.

If you still doubt this, download the J2EE Reference Implementation and load an accompanying JSP page to a wysiwyg html editor, such as Dreamweaver. the page is immediately filled with yellow areas, telling you all the "error" marks contained in the page. Of course, the yellow content comes from the JSP tag and code, rather than the real error on the page.

So far, the WYSIWYG editor supporting JSP has not appeared, and I have never heard of any projects related to it. Although the template engine has the same problem, many Java-based solutions, such as my favorite Enhydra, allow you to provide markup pages as input to Representation Technology. In this case, the designer can modify the page frequently as needed and re-provide the tag page. Run the engine or compiler that represents the technology to convert the markup page to an appropriate format, and do not need to modify any code in typical cases ). Finally, the ideal result was achieved: designers and developers perform their respective duties.

Therefore, pay attention to the commitment made by JSP technology and the implementation of its actual delivery. In practice, to make full use of the functions in a JSP technology-driven environment, developers must handle most of the tags, or at least let designers learn some JSP coding.

HTML and XML

One of the most serious defects of JSP technology is often overlooked. It is incompatible with XML. More specifically, JSP pages do not require XHTML compatibility, especially in the HTML field. XHTML is a World Wide Web Consortium W3C specification. At present, HTML Tag sets are defined in XML documents with good format instead of HTML 4.0.XHTML. For example, the <br> tag must be converted to <br/> to ensure XML compatibility. If this example is not clear, you can refer to the XML specifications listed in references, and the developerWorks article on XHTML ). The same rule applies to image tags, and in the upcoming XHTML 1.1), most of the font attributes and other styles are moved into the CSS style sheet. In addition, most standard HTML documents can be easily converted to XHTML 1.0, which means that they can be read using any XML-compatible parser, such as Apache Xerces, and can be processed as XML.

You will ask "what is the relationship ?". The answer is significant. Because XML is rapidly becoming a global standard for communications between applications and within the application. Using the XML format to transfer books allows any application that uses the basic XML data binding function to easily use the data of your application. Imagine that by migrating your data to the XML format, you can trade online with a credit card company! In most cases, your data representation also needs to interact with other companies. The most common case is the portal application, which accepts content from various providers, such as weather information, stock quotes, and news), usually with provider tags. However, JSP pages cannot work well in this environment because they mix code with the custom tag library.

JSP pages rarely have well-formed XML documents and do not pay attention to compliance with XHTML. However, the markup language like XHTML does not allow the use of various JSP custom markup libraries. However, more importantly, the code snippets inserted into the JSP page do not belong to any form of tag, so when another application processes them, a parser loading error will occur.

Before you raise your question, let's take a look at the entire situation. If the application allows the JSP page to be processed by the initial client, the results will be generated in pure HTML, WML, VoXML, etc ). However, most applications that request this data use a certain amount of cache because the network round-trip overhead is very expensive. In these cases, cached pages return outdated data. Therefore, you may be more willing to return XML-compatible results. It is best to use a static form. JSP technology is powerless in these cases; JSP pages must always be processed at runtime to remove JSP code scriptlets and tag libraries.

Let's take a look at the key test: Can other technologies do this? The answer is yes. The most authoritative leader in this field is the Apache Cocoon project, which is fully built on the basis of XML and An XSLT style sheet application that can be applied at run or static state. Because XML Server Pages is called XSP in the Cocoon framework) is actually an XML document, it is always compatible with XML. Technologies such as Tea and Enhydra XMLC that allow the input of pure markup language pages can also do so, although they are not intended here. In these cases, you can use XHTML or standard HTML. In addition, this is better than JSP technology, because JSP cannot implement XML in good format statically.

  1. Brief Introduction to JSP Technology
  2. Ten JSP tag libraries to be mastered
  3. Common Methods of form data storage in JSP Technology
  4. Detailed explanation of JSP technology methods
  5. How to Learn JSP Technology

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.