This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 40

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: 2849
    
  11

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: 16019
    
  20

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Debug Facelets