Hello, I'm developing an application with Restlet and GAE. Oks, I got this:

http://codetidy.com/4125/

public class MainRestletApplication extends Application {
    
    public MainRestletApplication()
    {
    //init code?
    } 


    @Override
    public Restlet createInboundRoot() {
        Router router = new Router(getContext());
 
        router.attach("/v1/mainstatus",MainStatus.class);
        router.attach("/v1/game/{id}/result",GameResult.class);
 
        return router;
    }
}

and this:
http://codetidy.com/4127/

                <servlet>
                <servlet-name>RestletServlet</servlet-name>
                
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
                <init-param>
                        <param-name>org.restlet.application</param-name>
                        <param-value>com.example.MainRestletApplication
                        </param-value>
                </init-param>
        </servlet>

        <!-- Catch all requests -->
        <servlet-mapping>
                <servlet-name>RestletServlet</servlet-name>
                <url-pattern>/*</url-pattern>
        </servlet-mapping>

------------------
Well, where can I put a method to init the Web Service, ergo, some code to init 
some data only when the app starts (one time), not when the first call coming.

Thanks

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3033171

Reply via email to