title: Executing web application with tomcat
body: <p>I have started using tomcat 7 for few days. I have tried executing many JAVA BASED web application with it. I actually want to check the flow of the java based web applications. That means in which sequence the methods of web application get executed. To do this I profile tomcat server with java profiler. </p>
  
  <p>My profiler works like this: </p>
  
  <ol>
  <li>I deploy war file of an application into web Apps dir of tomcat.</li>
  <li>I start the server by <code>./startup.sh</code></li>
  <li>I access the application in browser and execute it.</li>
  <li>I stop the server by <code>./shutdown.sh</code>.</li>
  </ol>
  
  <p>and after I stop the server, the profiler dumps the output in xml format(it shows heirarchy of methods as calling context tree).(MY profiler basically profiles methods of java classes.)</p>
  
  <p>As you know, may be because Tomcat is based on servlet, for 2 exactly same runs of an application(I follow above 4 steps 2 times and have 2 different output for 2 same runs), profiler gives different outputs. <strong>Q.1) I dont exactly know why this happens would be very curious to know the reason behind it.</strong> </p>
  
  <p>Also the output is very large (around 200 MB) even for simple application. To limit the size of the output and to have same outputs for 2 exactly same runs, I have excluded methods of org.apache.* from profiling. Because I am ultimately interested in knowing the flow of the web application itself.(to know in which sequence methods of web application get executed). For this scenario I have following questions.</p>
  
  <p><strong>Q.2)</strong> Running application by deploying war file and running it by fetching it form the directory itself can make difference in the output of the profiler ? or can it affect a sequence of methods in which they execute in both the cases ?</p>
  
  <p><strong>Q.3)</strong> I would like to know what happens when I execute jsp page of an application ? I mean how does tomcat execute them? step wise please....</p>
  
  <p><strong>Q.4)</strong> when I check the output of the profiler after executing an application, I see large no of methods from org/eclipse/jdt/internal/... get executed. So what do this classes do actually ? Why do I have them in my output ?</p>
  
  <p>Please let me know if I have failed to explain my questions. I kiind of searched a lot but could not find very precise answers to my questions.</p>
  
  <p>I would really appreciate your responses..</p>
  
  <p>Thanks you.</p>