Two Laptop Bag
The moose likes JSF and the fly likes Debug Facelets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Debug Facelets" Watch "Debug Facelets" New topic

Debug Facelets

Mauro Trevigno
Ranch Hand

Joined: Aug 27, 2012
Posts: 96

Hi guys,

I was trying to debug the following:

I found int he following thread that we are not able to debug facelets only #{} EL expression, but im trying to add a break point on #{survey.loadSurvey(24)} and im not able to do it.

Any better approach to use facelets with JSF 2.0?

Thanks & Regards,
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

In recent versions of JSF, you can pass parameters with the EL for action methods, but I don't think it's legal for basic text output like that. Actually, loadSurvey sounds like it should be an action, but the way it appears in the page makes it look like the value of a bean property. What are you expecting to happen there?

In any case, if you have legal syntax, then the EL is backed by Java. With a development tool like Eclipse, you can set a breakpoint on the Java code, where ever you want to stop, and then attach the debugger to your application server. You don't set the breakpoint directly in the XHTML file, but when you go to that page in your browser, you will hit the breakpoint and can switch over to Eclipse to see what's what.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

One of the reasons why I perpetually discourage the use of EL for View-defined logic - especially complex EL - is that it can be a right royal to debug. Wherever possible, put the logic in a backing bean not in the View.

Beyond that, I agree with Greg. What you are trying to do looks really weird and I don't think it's done with an understanding of how the JSF (or HTTP) lifecyles work.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Debug Facelets
It's not a secret anymore!