File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes call a method by passing parameter in jstl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "call a method by passing parameter in jstl" Watch "call a method by passing parameter in jstl" New topic

call a method by passing parameter in jstl

pk mishra

Joined: Feb 03, 2011
Posts: 1
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: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

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60045

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).

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: call a method by passing parameter in jstl
Similar Threads
c:if doubt
check boxes retrieving problem
How can i get session value in my JSP page using JSTL
how to overwrite a request param?