sails is a npm package for node.js, and so, works with any npm packages, including node-java. I have created a small demo for you using sails.js and a simple java class.
Note that I had to import the jar file into Java's classpath, then I invoked the method in a synchronous way.
module.exports = {
/**
* Action blueprints:
* `/gettoken/get`
*/
get: function (req, res) {
// Send a JSON response
var java = require('java')
java.classpath.push("C:/Users/cleuton/proj/sails.js/testProject/api/controllers/jsondao.jar")
var javaObject = java.newInstanceSync("com.obomprogramador.sails.test.SampleJava")
return res.json({
hello: javaObject.getTokenSync()
});
},
/**
* Overrides for the settings in `config/controllers.js`
* (specific to GetTokenController)
*/
_config: {}
};