Struts behind the scene
Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly
RE: Struts behind the scene
Shelly, I'm not sure I fully understand the question, but I'll give it a shot. Struts does not generate anything. You write the JSP's that Struts uses. When your JSP pages are invoked the first time, the web container (i.e. Tomcat, etc.) compiles the JSP's and renders them. That's why it is slow the first time. Hope that helps. -Original Message- From: [EMAIL PROTECTED] at INTERNET [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+ 20INTERNET @alltel.com] Sent: Wednesday, August 29, 2001 2:27 PM To: [EMAIL PROTECTED] at INTERNET Subject: Struts behind the scene Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly
Re: Struts behind the scene
Hi, I meant like when we invoke a jsp page that is using a template to render itself, does it then take the template, insert the relevant stuff into the template and then what? Actually i'm confused too. Lets say i have a template A, renderer jsp B and a content page say C, SO are these all put together into a precompiled jsp which is then compiled and rendered or how does it all work Thanks Shelly Greg Reddin wrote: Shelly, I'm not sure I fully understand the question, but I'll give it a shot. Struts does not generate anything. You write the JSP's that Struts uses. When your JSP pages are invoked the first time, the web container (i.e. Tomcat, etc.) compiles the JSP's and renders them. That's why it is slow the first time. Hope that helps. -Original Message- From: [EMAIL PROTECTED] at INTERNET [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+ 20INTERNET @alltel.com] Sent: Wednesday, August 29, 2001 2:27 PM To: [EMAIL PROTECTED] at INTERNET Subject: Struts behind the scene Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly
Re: Struts behind the scene
This might help http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb_p.html The template library basically nests the JSP include feature. For more about Java ServerPages, see http://husted.com/about/struts/links.htm#jsp Shelly Dhiman wrote: Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly
RE: Struts behind the scene
To be more exact, JSP's are pre-compiled into a special servlet source (java files). The servlets are compiled into classes. There exist mechanism for pre-compiling the JSP to classes, before the first user request is received. You can find these special servlet .java files in the tomcat/work/ directory. There is no rendering mechanism per-say. In the end, the JSP/Java files write information using JspWriter class that subclasses from java.io.Writer. To me, a JSP is just another view of a Servlet, without all the ugly print statements. The reason this is important, is that you can do all those things that servlets can do, well sort of. -Original Message- From: Greg Reddin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 2:00 PM Subject: RE: Struts behind the scene Shelly, I'm not sure I fully understand the question, but I'll give it a shot. Struts does not generate anything. You write the JSP's that Struts uses. When your JSP pages are invoked the first time, the web container (i.e. Tomcat, etc.) compiles the JSP's and renders them. That's why it is slow the first time. Hope that helps. -Original Message- From: [EMAIL PROTECTED] at INTERNET [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+ 20INTERNET @alltel.com] Sent: Wednesday, August 29, 2001 2:27 PM To: [EMAIL PROTECTED] at INTERNET Subject: Struts behind the scene Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly
Re: Struts behind the scene
Thanks Shelly malcolm davis wrote: To be more exact, JSP's are pre-compiled into a special servlet source (java files). The servlets are compiled into classes. There exist mechanism for pre-compiling the JSP to classes, before the first user request is received. You can find these special servlet .java files in the tomcat/work/ directory. There is no rendering mechanism per-say. In the end, the JSP/Java files write information using JspWriter class that subclasses from java.io.Writer. To me, a JSP is just another view of a Servlet, without all the ugly print statements. The reason this is important, is that you can do all those things that servlets can do, well sort of. -Original Message- From: Greg Reddin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 2:00 PM Subject: RE: Struts behind the scene Shelly, I'm not sure I fully understand the question, but I'll give it a shot. Struts does not generate anything. You write the JSP's that Struts uses. When your JSP pages are invoked the first time, the web container (i.e. Tomcat, etc.) compiles the JSP's and renders them. That's why it is slow the first time. Hope that helps. -Original Message- From: [EMAIL PROTECTED] at INTERNET [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+ 20INTERNET @alltel.com] Sent: Wednesday, August 29, 2001 2:27 PM To: [EMAIL PROTECTED] at INTERNET Subject: Struts behind the scene Hi, Could somebody explain me how struts work behind the scenes. The particular case being there is template, content and the renderer. So does it create precompiled jsps or how does it work coz the very first time you render a page it's very slow Shelly