• 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
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

jsp:getProperty name shows only first word in string.

 
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The lastName property is "Smith Jones", but only "Smith" is displayed.

When I view the browser source I see

so in html the quotes are missing as in value="Smith Jones"

When I save the html and change it to

"Smith Jones" is displayed properly.

Lines 26 and 27 contain is where the issue is.

I have also tried using
value='<jsp:getProperty name="employee" property="lastName" />'
that I found when googling jsp:getproperty truncates bean data at first blank.

How do I get the quotes into the property?

Thanks,

Lou


 
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The highest level observation is that using scriptlets and antiques like <jsp:getProperty> is about 10 years out of date.

But the easy answer is: value="<jsp:getProperty name="employee" property="lastName"/>">

The quotes should be in the template text, not in the value of the property.
 
Lou Pelagalli
Ranch Hand
Posts: 150
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose it would help too if I change the correct source file.

Doh!

No Emoticons for slapping myself in the forhead.

The highest level observation is that using scriptlets and antiques like <jsp:getProperty> is about 10 years out of date.



So Bear, what is the 2011 way?
 
Bear Bibeault
Sheriff
Posts: 67663
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since the inception of JSP 2 in 2002, the JSTL and EL should be used in place of scriptlets and the old property actions.
 
This tiny ad is guaranteed to be gluten free.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic