tags:

views:

184

answers:

2

At a previous job they had a debug mode that would highlight struts tiles in the browser so you could tell what each tile was doing and the tile's filename. This was enormously helpful for when you are lost in a forest of nested tiles. Now that I'm at a new struts place, I've been trying to figure out how to implement it but I'm coming up empty. Any ideas?

A: 

the following code works for me (in a jsp):

   Object nestedTilePath = request.getAttribute("javax.servlet.include.request_uri");
   String thePath;
   if (nestedTilePath != null){
     thePath = nestedTilePath.toString();
   } else {
     thePath = request.getRequestURI();
   }
   out.println(application.getRealPath(thePath));

so, you could incorporate that into a tag that you'd put into each of your tiles, wrapping the code in an if (debugMode) check.

Hope that helps!

Michael Rush
A: 

It will probably only get you halfway there, but I downloaded a tool for firefox called WebDeveloper. It outlines tables and cells very nicely.

Aaron

Aaron