This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException" Watch "binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException" New topic
Author

binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException

khld qr
Greenhorn

Joined: Mar 29, 2014
Posts: 1
I am working on eclipse kepler, JSF 2.2 with PrimeFaces 4.0 / Mojarra 2.2 library.

actually there are 2 Problems:

-

I still get this server message no matter what I do.

(( javax.el.PropertyNotFoundException: /Order.xhtml @28,76 value="#{kk.refugee.id}": Target Unreachable, 'refugee' returned null))

and if I delete the input text puls the hidden, the message keeps pop up for 'material' selectOneMenu.

-

I have no chance to examin : ((is this javascript code correct, to copy the value of one component to the other.))

these are my xhtml file and java calsses.
thank you in advanced.

**kk.java**
-----------

RefugeeMan.java
---------------

Order.xhtml
-----------
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17038
    
  26

I see 2 problems.

1. The JavaBean standard requires that Class names start with an upper-case character, but member (property) and instance names (JSF backing bean names, for instance) start with a lower-case letter.

You named your backing bean class "kk", when "Kk" would have been more appropriate. Since you didn't explictly provide an annotation to name the instance created, the standard mechanism would have attempted to convert the class name (Kk) into an instance name (kk). What it would do in a case where the class name didn't start with a lower-case letter may not be what you think.

2. Your error message says it all: Target Unreachable, 'refugee' returned null)

In other words, you never initialized the property named "refugee" in your "kk" object. Since the EL expression:



effectively gets read as



and the getRefugee property method call is returning null (since refugee wasn't initialized). Which throws a NullPointerException that JSF intercepts and converts to an error message.


An IDE is no substitute for an Intelligent Developer.
 
Have you checked out Aspose?
 
subject: binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException
 
It's not a secret anymore!