Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

Function Re-use in JSTL

Hey experts,

  Is there a way to make a user-defined function in JSTL  in order to do something such as percentage computation or in order not to repeat a block of JSTL code; or is the only way to do that is to write this function in the java bean or object class, and then call it from JSTL?? any help on the best method to do this??
Avatar of suprapto45
suprapto45
Flag of Singapore image

I think that the best way would be to create a custom tag (similar to JSTL) by your own.
Avatar of mte01

ASKER

>>suprapto45

Is there an easier way, or how difficult is creating tags of my own?
Avatar of mte01

ASKER

>>suprapto45

Note please that I am only modifying few pages in a project that is not mine, so I can't manipulate much the project's libraries
SOLUTION
Avatar of Manish
Manish
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

How do I know which JSP version this project is on & which JSTL version I am using?

(I am confused a bit also about the differences between JSTL 1.0,1.1 & 1.2)
Sorry,

I just went back. Well I think that you should have enough information by now ;)

David
>& which JSTL version I am using?  
Which directive are you using ?  
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>  //   this is for JSTL 1.0  
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>  this is for JSTL 1.1
Avatar of mte01

ASKER

It turns out that I am using JSTL 1.0 with JSP 2.0; I guess the info that you gave is fine; many thanks for your help guys!