问题描述
我使用 JDeveloper ,开始为工作中的项目开发一组网页.由于当时我对JDev不太了解,因此我跑到Oracle来学习一些教程. JDev教程建议使用 JSPX ,而不要使用 JSP ,但并未真正解释原因.您正在开发JSPX页面吗?您为什么决定这样做?进行JSPX路由的利弊是什么?
Using JDeveloper, I started developing a set of web pages for a project at work. Since I didn't know much about JDev at the time, I ran over to Oracle to follow some tutorials. The JDev tutorials recommended doing JSPX instead of JSP, but didn't really explain why. Are you developing JSPX pages? Why did you decide to do so? What are the pros/cons of going the JSPX route?
推荐答案
主要区别在于JSPX文件(正式称为"JSP文档")可能更易于使用,因为对格式正确的XML的要求可能允许您的编辑器可在您键入时识别更多的拼写错误和语法错误.
The main difference is that a JSPX file (officially called a 'JSP document') may be easier to work with because the requirement for well-formed XML may allow your editor to identify more typos and syntax errors as you type.
但是,也有缺点.例如,格式正确的XML必须转义小于号之类的内容,因此文件的最终内容可能为:
However, there are also disadvantages. For example, well-formed XML must escape things like less-than signs, so your file could end up with content like:
<script type="text/javascript">
if (number < 0) {
XML语法也可能更冗长.
The XML syntax may also be more verbose.
这篇关于我应该使用JSPX而不是JSP吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!