Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Field display problem

 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying a simple application. Here is my JSF page



When I render this page I am getting this value #{LoginForm.userName} in the text field. Please find the attachment for the screen shot.

Thanks for your help in advance.

login.JPG
Login Page
[Thumbnail for login.JPG]
 
Davie Lin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take out the value attribute
 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Davie,

In that case how can I bind the value to bean property?

Thanks,
 
Davie Lin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to bind that value to the backing bean
you use binding, not value.

Plus, you don't have to use binding attribute to get the value, you can use FaceContext.
 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Davie,

I was following Rich Faces example in roseindia. I think we can do this way but I tried as you said I got the following exception



Thanks in advance.
 
Davie Lin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you remove the value attribute? do you understand why the exception?
 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I have removed the value attribute. I guess in the bean we have to declalre the property as HtmlInputText when you use binding attribute. I am not sure I was looking at online example.

Sorry I am quite new to JSF I just started couple of days back.
 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't know what is wrong with tomcat it works in Jboss. When I deploy the same application in jboss I get the empty text fields as I expected.

Please help to get this done in tomcat.
 
Davie Lin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post your relevent code
 
jaisai vijay
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have attached my full code.

my login.jsp



faces-config:



web.xml



LoginForm:



Thanks for the help.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic