• 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

Display tags and Jsp Scriptlet

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a table define like this
<display:table name="sessionScope.userInfo.partnerList" id="partner" class="ResultsTable">
In the column

<display:column title="Partner" sortable="true" headerClass="ColumnHdg" >
<myTag:message key="<%=DataKey+(String)partner.getFocusLevel()%>"/>
</display:column>

It gives me the error saying cannot find getFocusLevel MEthod...

but if I use the JSTL ${partner.focusLevel}, the value is displayed..

using JSTL is not a solution for me as myTag does not evaluate ${partner.focusLevel}
any ideas?

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


You can test the instance type of parter before calling getFocusLevel() to find out what instance you are getting. That must give you some direction to find out the problem
[ June 29, 2006: Message edited by: Purushothaman Thambu ]
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most probably the scriptlet variable "partner" is being exposed only as a java.lang.Object.

JSTL works, because it uses introspection and reflection to see the actual properties a bean has.
The scriptlet code knows only that the variable 'partner' is an object.

so this could possibly work:
<% ((com.mypackage.Partner)partner).getFocusLevel() %>

If you have a JSP2.0 container, is there anything stopping you using the EL expression rather than the <%= expr %>?
 
Rajani Deshpande
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
thanks .. Casting it helped.. It works !
I cannot use JSTL because, we have a custom tag which doesnt recognize nested JSTL tags...
I would love to use JSTL in this custom tag.. any pointers on how to make the custom tag recognize the JSTL ${variable} will be helpful..

Thanks for the help
Rajani
 
Sheriff
Posts: 67747
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
I can think of no reason that JSTL and EL cannot peacefully co-exist with well-written and designed custom actions. What is it that you are doing that is preventing this from working? Are you disabling the evaluation of the body of the custom actions? If so, why?
 
reply
    Bookmark Topic Watch Topic
  • New Topic