Interpolate Variables via Java and Jersey

9 views
Skip to first unread message

Joe Toth

unread,
Oct 26, 2011, 12:08:45 AM10/26/11
to sca...@googlegroups.com
I am able to run scalate from my project with Java, but I'm not sure how to go about passing models to my templates. The following works if I don't return a Viewable or have a variable reference in the template. What am I doing wrong pass a model to the template? Do I have to use Viewable or can I just return the Object? - Thanks

// xxx.UserResource
@GET
@Path("name")
public Viewable myname() {
    return new Viewable("name", Util.hashmap("name", "joe"));
}

// xxx.UserResource.name.jade
h1
  Hi ${name}
Reply all
Reply to author
Forward
0 new messages