Technical differences between ASP.NET and Java Servlets / JSP

前端 未结 2 1809
谎友^
谎友^ 2021-02-08 06:42

My understanding of JSP is that every JSP page on first load is compiled into a Java Servlet. Is this the same for ASPX pages (of course, not into a servlet, but whatever the AS

2条回答
  •  粉色の甜心
    2021-02-08 06:52

    JSP pages are translated into Java source code, then compiled into class files (containing Java Byte Code) for future execution. After that, they're actually JIT (Just In Time) compiled by the JVM when they are needed for execution (so they're pretty fast).

    It's my guess that there's a similar process for .NET applications, in that they are compiled into .NET assemblies. This is sort of like Java's class files, except they are IL (Intermediate Language) to run on the CLR. At run time, IL is also translated into native machine instructions for execution.

    The actual build / runtime mechanisms (from a high level) are probably surprisingly similar.

    EDIT

    Here are some details regarding ASP.NET : http://msdn.microsoft.com/en-us/library/ms366723.aspx

    Also, with Java based web applications, containers which run them can be configured to pre-compile JSPs when the application is deployed. Then, the JVM loads the class files into memory, and handles JIT compilation / caching from that point forward.

提交回复
热议问题