I want to initialize a generic servlet on load-on-startup = 1. I read
on GAE docs that this feature is supported but happen only when first
request comes, not prior to it. But its not working. I dont know
whether on local and production it has same behavior.

Will anyone please guide me if I can do that?

My Generic servlet code:

public class StartupServlet extends GenericServlet {
        public void service(ServletRequest arg0, ServletResponse arg1)
                        throws ServletException, IOException {
                 String serverInfo = getServletContext().getServerInfo();
         if (serverInfo.contains("Development")) {
                 FFConstants.DEV_MODE = true;
         }else {
                 FFConstants.DEV_MODE = false;
         }
        }
}


Web.xml enteries

  <servlet>
    <servlet-name>StartupServlet</servlet-name>
    <servlet-class>com.servlet.StartupServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>StartupServlet</servlet-name>
    <url-pattern>/Startup</url-pattern>
  </servlet-mapping>

--

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-j...@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.


Reply via email to