I have started reading JSP. I came across JSP implicit object, say for example, session, application etc. And after reading EL expression, i came to know there are also implicit object for EL expression.
My question is what is the difference between these implicit objects?
Even though they are semantically the same, why does they create EL and makes thing’s little bit hard?
Correct me if am wrong
There isn’t any difference in the object that you’re getting, it’s just different ways of accessing the same objects in each of the technologies. For example,
requestin a JSP will give you the same object as${pageContext.request}in EL.In the case of EL, additional implicit objects are available for convenience, such as
paramorrequestScope. You could still get the same data, but the syntax would be clumsy.You might wish to compare this to implicit objects in a JSP vs. a ‘lack’ of implicit objects in Servlets. JSP implicit objects are not different from the objects that you can get a hold of in a Servlet, it’s just that the implicit objects make for cleaner syntax. For example, the implicit
sessionobject is the same that you would get viaHttpServletRequest#getSession(). An exception to this is thepageContextwhich has no equivalent in Servlets.