This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL expression not working" Watch "EL expression not working" New topic
Author

EL expression not working

Jade Lucky
Greenhorn

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?

Thanks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

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
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.

user1.jsp


web.xml

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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
 
 
subject: EL expression not working
 
Similar Threads
JSP with DWR.XML
Servlet filter not getting invoked
JSP Init Param
Flushing response and then forwarding not working as expected
EL is not working with JSTL