playframework 2.1 - how to invoke a play application without hitting the URL (http request)? -


i'm using play application (using play version 2.1.0) rabbitmq , not have view component. invoke play application without hitting execution url (http://localhost:9000/<routing_info>) on server startup.

would know if there way in play 2.1.0 version run application on server startup, mean bootstrapping. option available in play 2.1.0. i've read through documentation mentioned 1.2 version.

please help!!

play allows define 'global' object instantiated automatically play when application starts.

in application.conf should find following:

# global object class # ~~~~~ # define global object class application. # default global in root package. application.global=global.global 

on new play application, line commented out. i've uncommented , made point object called global in global package. can make ever want.

your global object should extend globalsettings.

in applications, use static initialiser block run code when class loaded:

public class global extends globalsettings {   static   {     ...   } } 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -