Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug JSTL?

I'm using SpringSource Tool Suite (with Roo) and have some success. What bothers me though is that I don't know how to debug tag library-stuff.

I may add breakpoints but it never stops at them.

What I'm looking for is a dump of all current variables in the context.

Up until now I did something like:

<c:forEach items="${data}" var="item">
    <c:out value="${item}"></c:out><br />
</c:forEach>

Sadly, that's difficult to read and also not pretty straightforward.

What can I do to improve this?

like image 527
Hedge Avatar asked Aug 04 '11 17:08

Hedge


2 Answers

this was always tricky, for future visitors of this question adding my 2 cents

if you put a break point on the jsp in Eclipse on the line

Eclipse debug for JSTL

like image 59
Venkat Avatar answered Sep 23 '22 05:09

Venkat


Sorry, but you can't put debug points to a file containing markup. In this case, the tag library definition is in the form of a markup. So, instead of debug, you only get validation support for them.

An exception would be a Java Server Pages (JSP) file, which would be converted to a servlet (program code) at the runtime.

Debugging is only possible for scripts and code which have a defined execution sequence.

The best way to overcome this is to go through the documentation carefully and incrementally implementing the tags after getting knowledge on XML or the related markup language.

like image 42
bhagyas Avatar answered Sep 20 '22 05:09

bhagyas