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??
Java EEJSP

Avatar of undefined
Last Comment
mte01
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
mte01
Flag of Lebanon image

ASKER

>>suprapto45

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

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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of rrz
rrz
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of mte01
mte01
Flag of Lebanon image

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)
Avatar of Manish
Manish
Flag of India image

For jsp version ,check this
http://www.jguru.com/faq/view.jsp?EID=35085
Avatar of suprapto45
suprapto45
Flag of Singapore image

Sorry,

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

David
Avatar of rrz
rrz
Flag of United States of America image

>& 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
mte01
Flag of Lebanon image

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!
Java EE
Java EE

Java Enterprise Edition (Java EE) is a specification defining a collection of Java-based server and client technologies and how they interoperate. Java EE specifies server and client architectures and uses profiles to define technology sets targeted at specific classes of applications. All Java EE profiles share a set of common features, such as naming and resource injection, packaging rules and security requirements.

18K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo