Skip to Content
Head First Servlets and JSP, 2nd Edition
book

Head First Servlets and JSP, 2nd Edition

by Bryan Basham, Kathy Sierra, Bert Bates
March 2008
Intermediate to advanced
911 pages
20h 31m
English
O'Reilly Media, Inc.
Content preview from Head First Servlets and JSP, 2nd Edition

EL: the answer to, well, everything.

Or almost everything. But certainly an answer to two big complaints about putting actual Java into a JSP:

  1. Web page designers shouldn’t have to know Java.

  2. Java code in a JSP is hard to change and maintain.

EL stands for “Expression Language”, and it became officially part of the spec beginning with JSP 2.0 spec. EL is nearly always a much simpler way to do some of the things you’d normally do with scriptlets and expressions.

Of course right now you’re thinking, “But if I want my JSP to use custom methods, how can I declare and write those methods if I can’t use Java?”

Ahhhh... writing the actual functionality (method code) is not the purpose of EL. The purpose of EL is to offer a simpler way to invoke Java code—but the code itself belongs somewhere else. That means in a regular old Java class that’s either a JavaBean, a class with static methods, or something called a Tag Handler. In other words, you don’t write method code into your JSP when you’re following today’s Best Practices. You write the Java method somewhere else, and call it using EL.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Java, 2nd Edition

Head First Java, 2nd Edition

Kathy Sierra, Bert Bates
Head First Java, 3rd Edition

Head First Java, 3rd Edition

Kathy Sierra, Bert Bates, Trisha Gee
Learning Java, 6th Edition

Learning Java, 6th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 9780596516680Errata PageSupplemental Content