permaculture playing cards*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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
Author

JSP 2.1 and Unified EL 2.1

Johnnie Smith
Greenhorn

Joined: May 02, 2012
Posts: 22
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,
John
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60074
    
  65

What possible use would deferred expressions have in a JSP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Johnnie Smith
Greenhorn

Joined: May 02, 2012
Posts: 22
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
Bartender

Joined: Jul 06, 2005
Posts: 1016
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.

Basically
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
 
Similar Threads
JSP book of examples of new stuff?
javax.el package
JSF 1.1 vs. JSF 1.2
EL use
Show HashMap forEach