SmartNSF is in Beta 5

In case you've missed Christian's latest release of SmartNSF, here is the link . Important addition is the Custom strategy, that allows you to define your own class to process the requests coming via route defined in SmartNSF, such as

router.GET("info") {
    strategy(CUSTOM) {
        javaClass "org.openntf.rest.MyCustomStrategy"
    }
}

and your class needs to implement CustomRestHandler interface

package org.openntf.rest;

class MyCustomStrategy implements CustomRestHandler {
  public void processCall(Context context, String path) {
    JsonJavaObject result = new JsonJavaObject;
    result.put("test", "hello there!");
    JsonWriter jsw = new JsonWriter(context.getResponse().getWriter(), true);
    jsw.outObject(result);
    jsw.close();
  }
}

Happy RESTing|

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
9 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.