This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL expression not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL expression not working" Watch "EL expression not working" New topic

EL expression not working

Jade Lucky

Joined: Apr 10, 2008
Posts: 9
Hi guys,
I tried the example shown in HF Servlet and JSP book for EL expressions and I could not get it working.

This is my first Jsp user1.jsp

My second Jsp is TestEL jsp

<%= application.getAttribute("mail") %> < - Only when it has this part, it works and Prints the user Name " Smily"
${applicationScope.mail} <- This part does not do so

My Web.xml is

Can someone see what i am doing wrong?

Ankit Garg

Joined: Aug 03, 2008
Posts: 9291

Checkout this if it helps...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Cindy Carney
Ranch Hand

Joined: Jan 12, 2010
Posts: 57
I have been working on this all afternoon, and have encountered the same problems as you. I am using Eclipse - what are you using?

I've tracked it down to the fact that the init-param is never successfully read - it comes IN as null, and that's why it's propagating as null farther on down the code.

Is there any Web expert out there that can tell us what we're doing wrong?

Cindy Carney
Ranch Hand

Joined: Jan 12, 2010
Posts: 57
Well, I finally switched to the Tomcat app server, and got a trivial example to work. However, the same code doesn't work with the built-in WebSphere app server.

I'm going to chalk it up to a container bug, at this point.



Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

I'm going to chalk it up to a container bug, at this point.

It's difficult to believe. What is the version of the server ? Which servlet/JSP API does it support ?

[My Blog]
All roads lead to JavaRanch
It is sorta covered in the JavaRanch Style Guide.
subject: EL expression not working
Similar Threads
Flushing response and then forwarding not working as expected
EL is not working with JSTL
Servlet filter not getting invoked
JSP Init Param