• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

visual jsf is about to kill me

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Saloon Keeper
Posts: 22503
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Of course, I found a very beautiful couch. Definitely. And this tiny ad:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic