• 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

call a method by passing parameter in jstl

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
i want to pass the variable as a parameter in a method. how can i do that.
my code is look like this


<c:set var="selectedDate" value="${Static.SELECTED_DATE}"/>

<c:if test="true">
<c:set var="selectedDate" value="${my:getCurrentMonth()}"/>

</c:if>
<c:set var="selectedDate" value="${my:formateDropDwnDate()}"/>


here i want to pass the variable selectedDate as a parameter in a method formateDropDwnDate .
i already declare the getCurrentMonth and formateDropDwnDate these two method in the mytld.tld fiel

 
Sheriff
Posts: 67746
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'm not sure exactly what you are asking, but I'll give it a try.

If you want to pass the scoped variable named selectedDate to an EL function that you've defined in your TLD (let's say that the function is named whatever), you'd just list in the parameter list. Such as:
But I'm not sure that's what you are asking.

Also, what is the sense of dropping the 'o' in the name formateDropDwnDate? Improve clarity by avoiding unnecessary abbreviations: name it formatDropDownDate using complete and real words (note that there's no 'e' in format).
 
Wanna see my flashlight? How about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic