wood burning stoves
The moose likes JSP and the fly likes JSP 2.1 and  Unified EL 2.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP 2.1 and  Unified EL 2.1" Watch "JSP 2.1 and  Unified EL 2.1" New topic

JSP 2.1 and Unified EL 2.1

Johnnie Smith

Joined: May 02, 2012
Posts: 23
I have Tomcat version 6.0.35 that supports JSP 2.1 and Servlet 2.4 installed on my system. It is said in the EL specification that JSP 2.1 includes the Unified

Expression Language 2.1. However when I code a simple JSP file to display "Hello World" message i.e. #{"Hello World"} instead of ${"Hello World"} , the JSP file does

not compile.

Can somebody tell me why this occurs? Isnt the Unified EL supported in JSP files? Is it only for .JSF files?

Thanks & Regards,
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

What possible use would deferred expressions have in a JSP?

[Asking smart questions] [About Bear] [Books by Bear]
Johnnie Smith

Joined: May 02, 2012
Posts: 23
I dont know about the use of deferred expressions in JSP as they are used in JSF to the best of my knowledge. I work with JSP, not JSF.

When I switched to JSP 2.1, I found these new topics in JSP 2.1 and EL 2.1 specifications. I tried to use the new stuff on my JSP in order to comprehend the new syntax but got the above mentioned problem.

Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
Check out the preface section of the JSP2.1 specification.
Deferred expressions only really apply to custom tags where you have specified that the attribute is deferred.
For the most part, I don't bother with them.

If you use #{deferredSyntax} in template text, it triggers a translation error (they don't make sense outside of a tag attribute)
If you use #{deferredSyntax} in a tag attribute, it depends upon the tld declaration for what version of JSP that taglib supports.
- JSP version supported < 2.1 == treat as literal
- JSP version supported >= 2.1 : treat as deferred attribute - as long as it is marked as such.

You can set the page attribute:

I agree. Here's the link: http://aspose.com/file-tools
subject: JSP 2.1 and Unified EL 2.1
It's not a secret anymore!