简体   繁体   English

在JSP技术中,翻译错误与编译错误有什么区别?

[英]In JSP technology, what's the difference between a translation error vs a compilation error?

Compilation error, fine it's the typical error you get when put wrong code. 编译错误,很好,它是放置错误代码时遇到的典型错误。 But how about this thing I'm reading about translation error?? 但是我正在阅读的有关翻译错误的内容呢? I've never encountered something like that in normal java. 我从未在普通的Java中遇到过类似的问题。 It's either it doesn't compile or it compiles.. pls help calrify what is a translation error? 它要么不编译,要么编译。.请帮助校准什么是翻译错误? Where does it come into the picture between 它在什么地方出现

  • compliation error (i know about) 修正错误(我知道)
  • runtime exception (i know about) 运行时异常(我知道)
  • translation error ----????? 翻译错误---- ?????

Translation Error : This type of Error occurs during the initial request. 转换错误:这种类型的错误发生在初始请求期间。 When a JSP page is first requested and goes through the initial translation from a JSP source file into a corresponding Servlet class file. 首次请求JSP页面时,它将经历从JSP源文件到相应Servlet类文件的初始转换。

JSP Page Translation: JSP页面翻译:

A java servlet file is generated from the JSP source file. Java servlet文件是从JSP源文件生成的。 This is the first step in its tedious multiple phase life cycle. 这是繁琐的多阶段生命周期中的第一步。 In the translation phase, the container validates the syntactic correctness of the JSP pages and tag files. 在翻译阶段,容器将验证JSP页面和标记文件的语法正确性。 The container interprets the standard directives and actions, and the custom actions referencing tag libraries used in the page. 容器解释标准指令和操作,以及自定义操作,引用页面中使用的标记库。

To read more about JSP - Life Cycle visit http://javapapers.com/jsp/jsp-life-cycle-explain/ 要了解有关JSP-生命周期的更多信息,请访问http://javapapers.com/jsp/jsp-life-cycle-explain/

With in the The Life Cycle of a JSP Page JSP页面的生命周期中

Those errors while Static data is transformed into code that will emit the data into the response stream. 将静态数据转换为代码后,这些错误会将数据发送到响应流中。

Read docs on the same Translation and Compilation 阅读有关相同翻译和编译的文档

A translation and compilation error occurs during the life-cycle of a JSP page. 在JSP页面的生命周期中会发生翻译和编译错误。

Translation errors occur when the JSP page is being translated to servlets and has to do with syntax errors in the JSP code. 当将JSP页面转换为servlet时发生转换错误,并且与JSP代码中的语法错误有关。 During translation each type of the data in the JSP page is treated differently,for example set and get properties are converted into method calls for javaBeans components etc.So a translation error would occur if the JSP page could not be translated to a servlet effectively. 在转换期间,对JSP页面中的每种数据类型都有不同的对待,例如将set和get属性转换为对JavaBeans组件的方法调用等。因此,如果无法将JSP页面有效转换为servlet,则会发生转换错误。 Compilation error occurs after a translation has occured(JSP page translated to servlet) that it occurs during the compilation of the translated servlet from the JSP and has to do more of the logic of your code than the syntax. 编译错误是在发生翻译(将JSP页面翻译为servlet)之后发生的,该错误是在从JSP编译翻译的servlet的过程中发生的,它必须执行比代码语法更多的代码逻辑。 If an error is either a translation or compilation error,the server will return a jasper exception and a message that includes the name of the JSP page. 如果错误是翻译错误或编译错误,则服务器将返回jasper异常和包含JSP页面名称的消息。 To learn more about translation and compilation: http://docs.oracle.com/javaee/5/tutorial/doc/bnahe.html 要了解有关翻译和编译的更多信息: http : //docs.oracle.com/javaee/5/tutorial/doc/bnahe.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM