• 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 ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Value is session managed bean's attribute is nulled

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a really weird thing happening right now. I'm using JSF with JPA. First off, I'm trying to print the values so I could see if the value I'm getting from the JSF page is correct.




Netbeans tried to put my controller in session scope which makes the attribute fixedItem of the fixedItem controller also in session scope.




Now, when I submit the form it will invoke a method called create which looks like this




As you can see, there are various print statements there for the employeeId attribute of fixedItem(the model not the controller this time). To my surprise, everything that is printed is null.


EMPLOYEE ID IN LOGXXXX: null
EMPLOYEE ID IN LOGX: null
EMPLOYEE ID IN LOGYYYY: null
EMPLOYEE ID IN LOG0: null
EMPLOYEE ID IN LOG1: null
EMPLOYEE ID IN LOG2: null
EMPLOYEE ID IN LOG3: null



The funny thing is that in JPA I am able to insert something in the database and it's the right value. I shouldn't be able to do this given that the values printed are all null. In my FixedItem.java(fixedItem model) the mapping looks like this...

@Embedded
private Employee employeeId;

Thanks!
 
The only cure for that is hours of television radiation. And this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic