Technical differences between ASP.NET and Java Servlets / JSP

前端 未结 2 1811
谎友^
谎友^ 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:51

    ASP can vaguely compare to JSP / Servlet. ASP.NET can vaguely compare to JSF (build on top of Servlet/JSP).

    ASP.NET and JSF are both component-based frameworks, while JSP and ASP are mostly view technologies.

    Done correctly, JSP/Servlet can be used to have an action-based approach where a controller process a command and forward to a view for rendering (MVC), which decouple view rendering from the business logic.

    But the approach taken by component-based framework is different and each component can trigger callbacks (business logic) and is responsible to render itself. They also rely on the concept of data binding, which does not exist as is in action-based framework.

    Component-based model are closer to programming model for desktop application, but abstract away the webby nature of the application. This is good and bad at the same time. It's bad when you want to optmize web-related things such as friendly URL, etc. That's I think why Microsoft introduced later on an action-based MVC framework next to ASP.NET.

提交回复
热议问题