aspose file tools*
The moose likes JSP and the fly likes problem with javaBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with javaBean" Watch "problem with javaBean" New topic
Author

problem with javaBean

Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
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

Joined: Jan 10, 2002
Posts: 61768
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
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

Joined: Jan 10, 2002
Posts: 61768
    
  67

You qouted everything but the once that counts.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

Do a View Source from the browser so you can see the generated HTML.
aslam parveez
Ranch Hand

Joined: Apr 25, 2006
Posts: 47
<input type="text" name="question" value= "<jsp:getProperty name=user property=question />">

check the quotes afetr value= .
Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
Thanks guys for all those replis...problem has solved.

Nandan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with javaBean