The moose likes JSF and the fly likes visual jsf is about to kill me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "visual jsf is about to kill me" Watch "visual jsf is about to kill me" New topic

visual jsf is about to kill me

Jorge Bendahan
Ranch Hand

Joined: Apr 11, 2008
Posts: 82
I never want to work again with visual jsf , Here is my problem: I have 2 pages, Client and Client_update. In the Client page, when I select a client from a table the selected client get's stored in the sessionBean and it gets redirected to Client_update and all the client attributes are displayed in this new page, the user can change some of these values and finally press a button to save those changes, but when i debbug, the fields always contain empty values. i noticed that the pre-render method get's called several times, so i setted up a flag to get the values only once, but still it doesnt work, what can i do?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I'll admit that when WYSIWYG designers for JSF become common, I'll have a much easier time of things, but you're giving a classic illustration of why IDEs are dangerous. They let you think you can do something even when you don't actually know what you're doing. I've dug myself into some pretty deep holes that way.

Your problem isn't in the IDE, it's in uderstanding JSF itself. One of the peculiarities of JSF is that in a request/response cycle, both the setter and getter methods for backing bean properties can end up getting called multiple times and at times and in ways that aren't easily predictable. For this reason, the mutator methods should not have side-effects. In particular, avoid database services (not only do you risk data corruption, the performance hits can be considerable).

From your particular complaint, however, I think you're using the wrong scope. Unfortunately, JSF tends to require a lot more in the way of session scope objects than most other platforms, mostly because of its extensive use of postback. Since request-scope objects get created from scratch at the beginning of every request/response cycle that needs them, stuff that doesn't get posted back and forth evaporates quickly.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: visual jsf is about to kill me
It's not a secret anymore!