Mentawai Web Framework

!en_US.templates.title!

!en_US.templates.intro!

!en_US.templates.template.jsp!

!en_US.templates.template.jsp.text1!


<%@taglib uri="/template" prefix="template"%>
<html>
  <head>
    <title>Mentawai with Templates</title>
  </head>
  <body>
    <table>
      <tr><td colspan="2"><template:block id="head"/></td></tr>
      <tr>
        <td width="25%"><template:block id="menu"/></td>
        <td><template:block id="body"/></td>
      </tr>
    </table>
  </body>
</html>

!en_US.templates.template.jsp.text2!

!en_US.templates.templateManager!

!en_US.templates.templateManager.text1!

public class TemplateManager extends org.mentawai.template.TemplateManager {

    public void configurePages() {
    
        Page base = new Page("template.jsp");
        base.setBlock("head", new Page("head.jsp"));
        base.setBlock("menu", new Page("menu.jsp"));
       
        Page page;
       
        page = new Page("/listNews", base); //Extends!
        page.setBlock("body", new Page("listNews.jsp"));
        add(page);

        page = new Page("/addPool", base); //Extends and redefinition!
        page.setBlock("body", new Page("addPool.jsp"));
        page.setBlock("menu", new Page("menu2.jsp"));
        add(page);      
    }
}

!en_US.templates.templateManager.text2!

!en_US.templates.convention!

!en_US.templates.convention.text1!

!en_US.templates.convention.text2!

!en_US.templates.convention.text3!

public class TemplateManager extends org.mentawai.template.TemplateManager {

    public void configurePages() {
    
        Page base = new Page(".*", "template.jsp", ConventionController.class);
        base.setBlock("head", new Page("head.jsp"));
        base.setBlock("menu", new Page("menu.jsp"));
        add(base);

    }
}

!en_US.templates.convention.text4!

!en_US.templates.note!