jeudi 26 mars 2015

Tracing what JSP files are being loaded by Apache Tiles?



I have Googled but not found anything relating to this, also have turned the logging up to INFO without any results (TRACE, DEBUG and ALL settings give me a weird Portlets error - odd, because we don't use portlets.)


Here's the problem:


We use a very complex multilayered Spring MVC/Apache Tiles setup, which makes it very difficult to tell which JSP fragments are being loaded upon return from a controller method. We use nested Tiles definitions and controller methods which call each other and then return one of up to a dozen different view names, each of which loads a different Tiles template.


I would like to know if there is a specific logging setting to identify which JSP fragments are being loaded by which view name. It would save a lot of manual tracing.


Example:



@RequestMapping("mything.html")
public String goofyController(Model model) {
if (x) then {
return ".tiles.thing1"
}
return ".tiles.thing2"
}


Tiles Definitions:



<definition name=".tiles.thing1" extends=".tiles.baseDefinition">
<put-attribute name="content" value=".otherTemplate.otherDefinition" />
</definition>


<definition name=".tiles.thing2" extends=".tiles.baseDefinition">
<put-attribute name="content" value=".otherTemplate.otherDefinition2" />
</definition>


<definition name=".otherTemplate.otherDefinition" extends=".otherTemplate.baseDefinition">
<put-attribute name="content" value="/WEB-INF/views/finally_a.jsp" />
</definition>

<definition name=".otherTemplate.otherDefinition2" extends=".otherTemplate.baseDefinition">
<put-attribute name="content" value="/WEB-INF/views/finally_another.jsp" />
</definition>


As you can see, manually tracing through all this stuff can be tedious. Some way of tracing this down would help a lot.




Aucun commentaire:

Enregistrer un commentaire