[appengine-java] JSP page as Warmup Servlet
Is it possible to use a JSP page as a warmup Servlet in Google App Engine for Java? Example: servlet servlet-namesearch/servlet-name jsp-file/search.jsp/jsp-file load-on-startup1/load-on-startup /servlet Sice JSP pages are compiled into Servlets this should work in theory, unless JSP pages and ordinary Servlets are treated differently under the hood. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] JSP page as Warmup Servlet
Yes. Warmup servlets are just URL for you to hit: http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_Requests http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_RequestsThat being said, why would you want to use a JSP as a warmup servlet? The code will be easier to test/maintain in a servlet itself. Worst case scenario you can always use JSP dispatch to the JSP. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine On Sun, May 15, 2011 at 11:18 PM, Anders i...@blabline.com wrote: Is it possible to use a JSP page as a warmup Servlet in Google App Engine for Java? Example: servlet servlet-namesearch/servlet-name jsp-file/search.jsp/jsp-file load-on-startup1/load-on-startup /servlet Sice JSP pages are compiled into Servlets this should work in theory, unless JSP pages and ordinary Servlets are treated differently under the hood. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] JSP page as Warmup Servlet
To be clear, load-on-startup just means the servlet will be *initialized* during the warmup request (not executed). For JSPs, this means that the jspInit() method is called. If you override it to do something expensive this may provide a big benefit, but otherwise you will just get the benefit of loading the JSP infrastructure ahead of time. If you really want to execute a JSP as a warmup request, you should declare it explicitly with a servlet using jsp-file and them map it to /_ah/warmup. On Mon, May 16, 2011 at 5:36 PM, Ikai Lan (Google) ika...@google.comwrote: Yes. Warmup servlets are just URL for you to hit: http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_Requests http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_RequestsThat being said, why would you want to use a JSP as a warmup servlet? The code will be easier to test/maintain in a servlet itself. Worst case scenario you can always use JSP dispatch to the JSP. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine On Sun, May 15, 2011 at 11:18 PM, Anders i...@blabline.com wrote: Is it possible to use a JSP page as a warmup Servlet in Google App Engine for Java? Example: servlet servlet-namesearch/servlet-name jsp-file/search.jsp/jsp-file load-on-startup1/load-on-startup /servlet Sice JSP pages are compiled into Servlets this should work in theory, unless JSP pages and ordinary Servlets are treated differently under the hood. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] JSP page as Warmup Servlet
Good. I thought it would be convenient to use an already existing JSP page as a warmup call. Plus, that makes it possible to ensure that the warmup call actually accesses the real logic of the application. And if/when the application changes, the warmup call will automatically reflect those changes without having to maintain a separate warmup servlet. Another thing that I'm not sure about yet is that maybe JSP pages get recompiled for every new Google App Engine instance! Then it's important to make warmup calls to all JSP pages that need to be compiled for fast first access. For example by having a separate warmup JSP page that does dynamic include of other JSP pages. Or maybe the compile if very fast nowadays. Or maybe JSP pages that are already compiled remains compiled when new Google App Engine instances are started. I have to research that. JSP dispatch from a separate warmup servlet could be a good idea. On Tue, May 17, 2011 at 12:36 AM, Ikai Lan (Google) ika...@google.comwrote: Yes. Warmup servlets are just URL for you to hit: http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_Requests http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_RequestsThat being said, why would you want to use a JSP as a warmup servlet? The code will be easier to test/maintain in a servlet itself. Worst case scenario you can always use JSP dispatch to the JSP. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine On Sun, May 15, 2011 at 11:18 PM, Anders i...@blabline.com wrote: Is it possible to use a JSP page as a warmup Servlet in Google App Engine for Java? Example: servlet servlet-namesearch/servlet-name jsp-file/search.jsp/jsp-file load-on-startup1/load-on-startup /servlet Sice JSP pages are compiled into Servlets this should work in theory, unless JSP pages and ordinary Servlets are treated differently under the hood. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] JSP page as Warmup Servlet
But if /_ah/warmup is mapped, then the documentation says that the service() method of the mapped servlet will be called: http://code.google.com/appengine/docs/java/config/appconfig.html#Using_a_Custom_Servlet Does the service() method in the compiled JSP servlet make a call to _jspService()? Otherwise the JSP page code will not be accessed. On Tue, May 17, 2011 at 12:43 AM, Don Schwarz schwa...@google.com wrote: To be clear, load-on-startup just means the servlet will be *initialized* during the warmup request (not executed). For JSPs, this means that the jspInit() method is called. If you override it to do something expensive this may provide a big benefit, but otherwise you will just get the benefit of loading the JSP infrastructure ahead of time. If you really want to execute a JSP as a warmup request, you should declare it explicitly with a servlet using jsp-file and them map it to /_ah/warmup. On Mon, May 16, 2011 at 5:36 PM, Ikai Lan (Google) ika...@google.comwrote: Yes. Warmup servlets are just URL for you to hit: http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_Requests http://code.google.com/appengine/docs/java/config/appconfig.html#Warmup_RequestsThat being said, why would you want to use a JSP as a warmup servlet? The code will be easier to test/maintain in a servlet itself. Worst case scenario you can always use JSP dispatch to the JSP. Ikai Lan Developer Programs Engineer, Google App Engine Blog: http://googleappengine.blogspot.com Twitter: http://twitter.com/app_engine Reddit: http://www.reddit.com/r/appengine On Sun, May 15, 2011 at 11:18 PM, Anders i...@blabline.com wrote: Is it possible to use a JSP page as a warmup Servlet in Google App Engine for Java? Example: servlet servlet-namesearch/servlet-name jsp-file/search.jsp/jsp-file load-on-startup1/load-on-startup /servlet Sice JSP pages are compiled into Servlets this should work in theory, unless JSP pages and ordinary Servlets are treated differently under the hood. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] JSP page as Warmup Servlet
Oh, only jspInit(), not jspService() that renders the actual page. Hmm... Then it's perhaps better to have a separate warmup servlet instead. Overriding the jspInit() method sounds like messy coding. Alternatively to have load-on-startup1/load-on-startup for both JSP pages and a separate warmup servlet that makes calls to the datastore etc can be used (and not map _ah_warmup so that the default warmup logic remains). -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.