• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

display text in jsp

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

I want to know if there is a html tag way to display text on the jsp page using a form (read only, no input).

Example, we use <html:text for an input field. Likewise, do we have any <html:label property="name" /> tag to display the text?

Thanks for your time.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a property called "foo" on a form bean called "MyForm", you can display this property as text on a jsp by writing the following:

<bean:write name="MyForm" property="foo" />

provided you have a <html:form name="MyForm"> tag prior to this statement.

You can also set up any javaBean for use by <bean:write> by including a <bean efine> tag prior to the statement.

If you wish it to look like a text box but not allow input, you can use the "readonly" attribute of the <html:text> tag.

Merrill
 
Suma Rangaraj
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merill. I tried and it works.
 
reply
    Bookmark Topic Watch Topic
  • New Topic