tags:

views:

37

answers:

1

if we write a code in jsp that will convert to servlet code and get runs. is it true? your suggestions are more thankful.

+4  A: 

From http://java.sun.com/developer/technicalArticles/javaserverpages/servlets_jsp/

How Do JSP Pages Work?

A JSP page is basically a web page with traditional HTML and bits of Java code. The file extension of a JSP page is .jsp rather than .html or .htm, which tells the server that this page requires special handling that will be accomplished by a server extension or a plug-in.

When a JSP page is called, it will be compiled (by the JSP engine) into a Java servlet. At this point the servlet is handled by the servlet engine, just like any other servlet. The servlet engine then loads the servlet class (using a class loader) and executes it to create dynamic HTML to be sent to the browser, as shown in Figure 1. The servlet creates any necessary object, and writes any object as a string to an output stream to the browser.

alt text

HTH

m3rLinEz
nice job. Thanks.
Praveen Chandrasekaran