It would be nice if there was some kind of GENERATED page content type for PageContentType.
In that case the content would refer to a class/bean that implements a certain interface which would generate the content for that page.
public interface PageGenerator {
String generate();
}
Example
public class LimitsPageGenerator implements PageGenerator {
@Value("${api.request.limit:-1}")
private int requestLimit;
public String generate() {
if (requestLimit >= 0) {
return "";
}
StringBuilder sb = new StringBuilder("<h2>Restrictions</h2>\n");
sb.append("You may only send an API request ").append(requestLimit).append(" times per minute.");
return sb.toString();
}
}
It would be nice if there was some kind of
GENERATED
page content type for PageContentType.In that case the content would refer to a class/bean that implements a certain interface which would generate the content for that page.
Example