tags:

views:

506

answers:

3

Is there a way to have default values for EL functions arguments (e.g., optional arguments)?

+1  A: 

you can make your own tags, which supply these values that will wrap the functions you are trying to call. JSP2.1 has .tag files that are basically jsp files, and it would be VERY easy to define default values using those.

mkoryak
A: 

I'm not sure if I understood. I want to use my functions as functions - ${f:get(...)}, not as tags. How can I assign a default value to an EL function using a .tag file?

A: 

Expressions like this?

#{foo.bar('argument')}

No, at least not yet. This is proposed for JSR 245, which should be part of Java EE 6. Kin-Man Chung explains here.

McDowell