JSP and Servlet

C

Chak

If i try to map the ASP.NET model to the JSP+Servlet model, would it be
metaphorically correct to map the .aspx page to a JSP, and the 'code behind'
to the 'controller' or servlet , in a MVC kind of architecture ?

Regards,

Chak.
 
L

Laurent Bugnion

Hi,
If i try to map the ASP.NET model to the JSP+Servlet model, would it be
metaphorically correct to map the .aspx page to a JSP, and the 'code behind'
to the 'controller' or servlet , in a MVC kind of architecture ?

Regards,

Chak.

No, it's incorrect. JSP corresponds to the older ASP architecture, where
the code (script) and the HTML code were mixed in a single file (and
also included files).

In ASP.NET, the ASPX file is a front-end for the UI components (in HTML
form), and the code-behind contains an intermediate layer between the UI
and the business layer. The business layer can be anything, DLLs, EXEs,
etc...

In other words, ASP.NET presents a cleaner separation between UI
components and code for the presentation layer.

Note however that it is still possible to write .NET code directly in
the ASPX page, thus coming closer to the ASP model, but it's not
recommended for a number of reasons.

Servlets are a different kind of "animal", they are more similar to
exposing an EXE through an URL. When called, the component examines the
HTTP requests, and creates a HTTP response, but it doesn't have a HTML
front end like in ASP, JSP or ASPX. I would compare servlets more to a
web service, which ASP.NET also has.

These concepts are a little difficult to explain without a schema, so I
apologize if I wasn't clear enough (or if I misunderstood one concept or
the other).

HTH,
Laurent
 
C

Chak

Thanks for your explanation.

I may be excused if i tried to then draw a parallel between a servlet and a
HTTPHandler in ASP.NET ?

Regards,

Chak.
 
L

Laurent Bugnion

Hi Chak,
Thanks for your explanation.

I may be excused if i tried to then draw a parallel between a servlet and a
HTTPHandler in ASP.NET ?

Regards,

Chak.

I am sorry, I am not familiar with HTTPHandler.

Laurent
 
J

Joerg Jooss

Hello Chak,
If i try to map the ASP.NET model to the JSP+Servlet model, would it
be metaphorically correct to map the .aspx page to a JSP, and the
'code behind' to the 'controller' or servlet , in a MVC kind of
architecture ?

Conceptually, you can map JSPs on ASP.NET pages and Servlets on HttpHandlers
(and ServletFilters on HttpModules), but the classic J2EE Front Controller
pattern is not used in ASP.NET.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top