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

Servlet/JSP creation/ invokation process?!

mark evertz
Greenhorn

Joined: Apr 11, 2002
Posts: 22
Can someone explain (detailed) how the creation
process of Servlets/ JSPs is working when invoked via an URL.
What I'm interested in is:
- When I call a .jsp page is there a generic servlet that interprets the whole page,
prints the static text to system.out and compiles the rest?
Does this servlet exist per Webapp, per servlet-engine, per folder - know what I mean??
I would like to know how the whole process is working.
Maybe someone can give some insights, that would great?
Thanks,
Mark
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
To my knowledge the server gets the 'asp' code, tranlates them into a servlet and then serves the client.
Depending on filtering set in your server a lot of other things may happen too ...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16070
    
  21

I never bothered to see if it's actually MANDATORY, but in practice, all the implementations I know about convert JSPs to their corresponding servlets.
Very greatly simplified (ignoring custom tags and such), items outside the <% %> delimiters are passed verbatim to generated out.print( item outside delimiters ) statements, and items INSIDE the delimiters - which are presumed to be Java code that just gets copied into the generated servlet's source code. After that's done, the generated servlet is compiled and the compiled servlet class is executed. Often the generated servlet source code is then discarded, since it's no longer needed, but usally there's a "keep generated" option so you can debug the JSP more easily.
There ARE situations where you have a "master servlet". The most common is where the web app is based on the Model/View/Controller design pattern. Or more precisely, on patterns that have been constructed in emulation of MVC. The original MVC requires more interactivity than HTTP servers can provide.
The latest and greatest incarnation of this revised MVC architecture is "Model 2". The Jakarta Struts framework is based on this architecture. You might want to read my quick introduction to Struts at http://www.devx.com/premier/mgznarch/javapro/2002/04apr02/th0402/th0402-1.asp


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet/JSP creation/ invokation process?!