This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 15952
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: binding xhtml and bean not working and the problem is : javax.el.PropertyNotFoundException
 
Similar Threads
Primefaces: How to insert an object attributes on a PanelGrid?
p:selectOneMenu is not working
To open JSF web page in new window for selected options
JSF 2.0 and AJAX Problem
selectonemenu does not update