aspose file tools*
The moose likes JSP and the fly likes JSP & Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP & Servlet" Watch "JSP & Servlet" New topic
Author

JSP & Servlet

D. Rose
Ranch Hand

Joined: Apr 25, 2003
Posts: 215
Hi,
I remember reading somwhere the following difference
Servelt spawna a new process for each client request while JSP's use single process but multiple threads.
Is it true?
Given that JSP in turn compiles into a servlet, I am not sure how this can be.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
The servlet engine uses a separate Thread for each request to a servlet - as you say, JSP turn into servlets. Servlet engines keep a pool of Threads so they don't have the expense of creating a new one for each request.
Bill
D. Rose
Ranch Hand

Joined: Apr 25, 2003
Posts: 215
Hi William ,
Thanks for your reply. I still have one doubt (may be foolish one!)
How does servlet engine know whether it's a simple servlet or JSP compiled servlet?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
I'm not sure what you mean... the servlet engine goes through some naming tricks to direct requests to a JSP to the equivalent compiled servlet, but as a programmer you don't have to worry about it.
Bill
D. Rose
Ranch Hand

Joined: Apr 25, 2003
Posts: 215
Hi Bill,
It's very true that as a programmer I need not worry.
I was asked in the interview about the difference in JSP and servlet.I answered what we discussed. But when I was counter questioned how can it be different when JSP also compiles into a servlet, I was baffled.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP & Servlet
 
Similar Threads
Transalation / Compilation
sharing of resources like html / jsp out of web application
Servlet limitation
Very funny behavior of sessions...
url-mapping: Process.jsp to Process servlet