• 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

problem in a bean

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am about developing a web application using JSF 2.0 and netbeans 7.1.2


I have a user bean UserBean wich is defined by








and a login form:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pou="http://primefaces.org/ui">


<pou:panel header="Login" widgetVar="dlg" style="width: 500px;height: 180px;" >
<h:form id="form" >

<h:panelGrid columns="2" style="margin-bottom:10px">
<h:outputText value="Username" />
<pou:inputText value="#{UserBean.username}"/>

<h:outputText value="Password" />
<pou:password value="#{userBean.password}" />
</h:panelGrid>

<h:panelGrid columns="2">
<pou:commandButton value="Connect" type="submit" action="#{userBean.login()}" ajax="false" />
<pou:commandButton value="Reset" type="reset" />
</h:panelGrid>

</h:form>
</pou:panel>


</html>



when I run the application and submit username and password I got the following error:


/loginForm.xhtml @13,62 value="#{UserBean.username}": Target Unreachable, identifier 'UserBean' resolved to null


is there any thing I have to add to the UserBean class??
thanks for help


 
Sheriff
Posts: 3034
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't put a name in the managed bean annotation, and I believe the default would be userBean, with a lowercase u.
 
rachid elmaazouz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Greg Charles wrote:You haven't put a name in the managed bean annotation, and I believe the default would be userBean, with a lowercase u.



Yes, but even when I change the @ManagedBean to @ManagedBean(name="userBean") the problem persist
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use #{userBean....} with a lowercase "u" consistently. You currently have UserBean and userBean.

Regards,
Brendan.
 
rachid elmaazouz
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Brendan Healey wrote:You need to use #{userBean....} with a lowercase "u" consistently. You currently have UserBean and userBean.

Regards,
Brendan.



Even when I change the userbean the problem persist, I think that I need reinstall the software and try again because, previously everything was fine and the form gives the desired result
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!