Answer the question
In order to leave comments, you need to log in
How do you like this way?
Good time of the day!
I am making one framework on Spring MVC, at one time I could not connect a template engine on a java config,
and I had to reinvent my wheel.
here's what I got:
the base template
here I am passing the paths that I store in the Map to the points ${head} ${adminHeader} ${adminContent} ${adminFooter}
something like:
adminTemplate.put("head", "/WEB-INF/ views/admin/options/header/adminHeadConfig.jsp");
adminTemplate.put("adminHeader", "/WEB-INF/views/admin/options/components/admin-header.jsp");
adminTemplate.put("adminFooter", "/WEB-INF/views/admin/options/components/admin-footer.jsp");
and here is the controller part:
here I am passing model.addAllObjects(renderView.getAdminTemplate()); the entire Map, it passes to the base template the paths that match in the Map and JSP page, i.e.: ${head} ${adminHeader} ${adminFooter}
and in the line model.addObject("adminContent" ,renderView.getAdminTemplate().get(" adminSEO"));
I pass the content itself, the content depends on the page type.
how do you like this decision?
put it into the furnace and use template engines or leave it as it is?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question