aspose file tools*
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
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
Author

call a method by passing parameter in jstl

pk mishra
Greenhorn

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

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61612
    
  67

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: http://aspose.com/file-tools
 
subject: call a method by passing parameter in jstl