Template « playframework « Java Enterprise Q&A





1. How to use layout via ".scaml" in play+play-scalate    stackoverflow.com

I'm using Play frameword and play-scalate plugin. The default demo of play-scalate provided is only ".ssp", but what I want to use is ".scaml". I create a "default.scaml", but I don't know ...

2. How to use #{field 'variable'}    stackoverflow.com

I read the documentation http://www.playframework.org/documentation/1.1/tags#ageta and I don't get it. Can someone provide a better, easier to understand example ?

3. java web playframework: how to ignore Evaluating Expression in a Template?    stackoverflow.com

In view (may be Application/index.html), I had the content like:

...
<div>${don't need evaluate this content} </div>
...
I don't want Play! evaluate it, only display absolutely this content on screen, so how can I ...

4. Using Play Templates Elsewhere    stackoverflow.com

Is it possible to use the templating engine from the Play Framework in other contexts? Ideally I'd like an api of the form:

String result = render("template-file.html",var1,var2);
In some frameworks ...

5. Play framework template For Loop    stackoverflow.com

I am trying to create a for loop in a play framework template like this :


  
    #{list items:1..${pageCount}, as:i}
  • ...

6. Play framework : how to use "moreStyles" and "moreScripts"    stackoverflow.com

In the file main.html, in default project created by Play!, there's this line :

#{get 'moreStyles' /}
I understand that if I need to add more styles, in my view script, ...

7. Java Playframework nested templates - argument passing    stackoverflow.com

Can you pass specific, limited number of arguments to a included,nested template ? For example, in ParentTemplate.html, to do something like this (consider this as pseudocode :) :

#{include 'path/to/ChildTemplate.html' arg1: someArgInParentTemplate, arg2: ...

8. How to reference submodule non-java resources (templates, js, css, etc)    stackoverflow.com

I have playframework application that uses my playframework module. There are some static content and views/tags in the module. My app works fine when I run it in dev mode. But when deployed to ...

9. What is the best practice to create array notation fields in play-framework templates?    stackoverflow.com

In one of my Play! projects I use a table of inputs to update multiple objects in one go. I pass it to the controller as an array of objects. This ...





10. renderJson without template    stackoverflow.com

I have controller with

render(messages);
And i have route
GET     /                    ...

11. How do I make session/cache variables available to my main.html template?    stackoverflow.com

I'm using Play Framework and setting a cache value as such:

String sessionId = Scope.Session.current().getId();
Cache.set(sessionId + "_user", "Doser");
and I want to ouput the value in my main.html without adding the value to ...

12. Can you recursively extend templates in Play Framework?    stackoverflow.com

In Play Framework, Can one use the #{extends} tag recursively? I.e., in a child template, extend a parent template, and in the parent template, extend yet another template, like so: child.html:

#{extends ...

13. Acquire Variables used from Parent Template in Play framework    stackoverflow.com

I want to use a variable which is used in main.html to all the child template. For Ex, I read a property called "ClientID" in main.html. This has to be used in all ...

14. Are Java constants availble for usage from within Play! templates?    stackoverflow.com

I have a User entity:

@Entity
public class User extends PortalModel {

    ...

    public enum Role {
        User,
   ...