Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with javaBean

 
Nandan Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am reading a bean using tag inside text box. like below:

<input type=text name=question value= <jsp:getProperty name="user" property="question" />>

But the problem is text box shows only one word. I mean to say if the return value of bean is "whats your pet name"..then text box will show only "whats"...nothing else.

I am confused when I did the same thing with following code:
<jsp:getProperty name="user" property="question" />
and this time its showed me "whats your pet name"..which is correct.

can any one help me please ?

ragards,
Nandan
always.nandan@gmail.com
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic HTML -- you need to quote your attribute values. Even though HTML 4 will let you get away with not quoting single-word values (XHTML will not), it's a really lazy and bad habit that results in problems just like this.

Always quote all your attribute values.
 
Nandan Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did but same problem ...I did like this ..pls let me if I am wrong
<input type="text" name="question" value= <jsp:getProperty name="user" property="question" />>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You qouted everything but the once that counts.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a View Source from the browser so you can see the generated HTML.
 
aslam parveez
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<input type="text" name="question" value= "<jsp:getProperty name=user property=question />">

check the quotes afetr value= .
 
Nandan Jain
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for all those replis...problem has solved.

Nandan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic