aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Debug Facelets" Watch "Debug Facelets" New topic
Author

Debug Facelets

Mauro Trevigno
Ranch Hand

Joined: Aug 27, 2012
Posts: 39

Hi guys,

I was trying to debug the following:


I found int he following thread https://forums.oracle.com/message/9656629 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,
-M
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2774
    
  10

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: 15665
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
 
subject: Debug Facelets
 
Similar Threads
Template not working
Starting with JSF 2.0 - Templates
javax.el.PropertyNotFoundException: Objetivo inalcanzable - JSF - Facelet - method-signature
Problem achieving masterpage functionality in JSF
Facelets Problem