This is the point: I want to create a layout for all my datagrids of my web applications using this template (example), if not what do you recomend to do this?: (IS NECESSARY TO BE DYNAMIC)
Layout.java
class Layout {
public abstract String buttons();
public abstract String data();
public String print()
{
String layoutOutput = "<div class=\"buttons\">";
layoutOutput = layoutOutput + this.buttons();
layoutOutput = layoutOutput + "</div>";
layoutOutput = "<div class=\"data\">";
layoutOutput = layoutOutput + this.data();
layoutOutput = layoutOutput + "</div>";
return layoutOutput;
}
}
MyList.java
class MyList extends Layout {
public String buttons()
{
return "<button>One</button><button>Two</button>";
}
public String data()
{
return "<table>...</table>";
}
}
MyJSP.jsp
<%
MyList l = new MyList();
response.write( l.print() );
%>