Search code examples
jspcoldfusionjsp-tags

Is there an equivalent to cfdump in JSP


I have been asked to do some work in the .jsp environment. I have very little experience and in order to better understand where I am starting I'd like to be able to "dump" some variable to look at. Coming from the CF world where cfdump is invaluable I am hoping there is something close in jsp but I can't seem to find it.

So the question is : Is there a jsp equivalent to cfdump or writeDump ? Or is there some native java that would get me close?


Solution

  • Depending on the complexity of the object you are dumping, you could convert it to JSON and then use browser debugging tools and console.log(). What is console.log?

    If you want the results outputted within the browser (like CFDUMP) the best option is to serialize as JSON and use CFDUMP for JavaScript: http://www.petefreitag.com/item/609.cfm

    NOTE: CFDUMP for JavaScript is used on http://cflive.net/ for safely dumping objects with ColdFusion 9 & RAILO.