JSPX is an important feature in JSP 2.0. JSPX is actually written in JSP in XML syntax. We know the format of JSP, in which an important feature is to include "<%" declare, JSP files typically appear as HTML code after server-side processing, although JSP usual purpose is to process web pages, but JSP code is presented Not the HTML or XML format we want, the code is very confusing, which is why JSPX appears.
JSPX fully symbol XML syntax specification, this standardization will bring a lot of benefits, and our coding will be much convenient, such as XML's convenient code formatting, easy to edit. Let's take a look at the traditional JSP code and the current JSPX code: (JSPX editing requires the IDEA 5.0 version)
JSP code:
Demo.JSP
<% @ Page ContentType = "text / html; charset = GB2312"%>
<% @ Page Import = "java.util. *"%>
<% @ Taglib Uri = "http://java.sun.com/jsp/jstl/core" prefix = "c"%>
hEAD>
<%
Date now = new date ();
Out.println (now.toString ());
%>
body>
html>
Demo.jspx
XMLns = "http://www.w3.org/1999/xhtml" XMLns: c = "http://java.sun.com/jsp/jstl/core" Version = "1.2">
hEAD>
Date now = new date ();
Out.println (now.toString ());
jsp: Scriptlet>
body>
html>
jsp: root>
In JSPX, we can't see the "<%" and "%>" symbols we are familiar with, which should be completely incompatible for these two symbols and XML format, if you want to use JSP Scriptle, you can use "
2 There is no graphical editing environment in the Intellij IDEA environment, but the editing function of the code is not weak. The IDEA provides a JSPX file template by default. If Web Module's changes, you can create a JSPX file. Intellij IDEA can edit JSPX as a normal HTML file according to HTML namespace, including prompts, CSS support, etc., and provide this code prompt of this named space, including XML's Schema and Java Taglib two ways, both of which are complete It can be integrated in the JSPX file, because JSPX is a standard XML file, formatted is possible. For JSP's default namespace, IDEA provides more support, such as automatic import import, JSP scriptlet code, etc., you will find these features when editing.
Summary: JSPX is indeed a gospel to the development, using XML syntax to write JSP files, which makes the code more standardized, standardized code is also the basis of graphical operation, plus namespace support for various Taglib, believe The editing JSP is very useful for future graphical ways.