• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

problem in a bean

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 3036
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I wasn't selected to go to mars. This tiny ad got in ahead of me:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic