• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

page attributes set using jsp:useBean

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Following is my test jsp. When I use useBean without a scope, i set an attribute at page scope right.
Can I access the same using EL as in line 5?
Can I access the same using scripting as shown in last line?
I have the tld appropriately done for func and my simple tag(bodycontent tagdependent). But call to function is printed as template text and the simple tag bodycontent did not print at all.

My output of the jsp is only this
56789 ${xyz.telephone} ${func.MyFunc()} within doTag:hi!

Where do I err?
Thanks and have a nice day
Subha

<jsp:useBean id="xyz" class="com.MyModel" >
<jsp:setProperty name="xyz" property="telephone" value="56789" />
</jsp:useBean>
<jsp:getProperty name="xyz" property="telephone"/>
${xyz.telephone}
<%@ taglib prefix="func" uri="http://subha/home" %>
<%@ taglib prefix="myst" uri="http://subha/home" %>
${func.MyFunc()}
<myst:MyST srt="hi!">
<% pageContext.getAttribute("xyz").getTelephone(); %>
</myst:MyST>
<% ((com.MyModel)pageContext.getAttribute("xyz")).getTelephone(); %>
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


I think the EL is not enabled on your container. Also use <%= instead of <% to print the values.

For the Simple tag, unless you use getJspBody.invoke(null) to print the body, it will not print the body.


Thanks
[ March 29, 2006: Message edited by: Narendra Dhande ]
 
subathra sangameswaran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much!
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic