File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL ignored Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL ignored" Watch "EL ignored" New topic
Author

EL ignored

Reena Nagdev
Greenhorn

Joined: Dec 27, 2008
Posts: 4
Refering to chapter 8 of Head First Servlets and JSP.
Here is my JSP code:

<html><body>
Dog’s name is: ${person.dog.name}
</body></html>

Expected output:
Dog's name is: Spike

Actual output:
Dog's name is: ${person.dog.name}

web.xml does not have el-ignored tag, nor does my JSP has isELIgnored="true"

I would appreciate any help on this.
Thanks in advance.


SCJP 1.5
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Your web.xml is probably not configured properly. Check this FAQ.


[My Blog]
All roads lead to JavaRanch
Reena Nagdev
Greenhorn

Joined: Dec 27, 2008
Posts: 4
Christophe Verré wrote:Your web.xml is probably not configured properly. Check this FAQ.


Thanks for reply.
I changed my web.xml accordingly.

Here is my web.xml

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>TestBeanServlet</servlet-name>
<servlet-class>TestBeanServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>TestBeanServlet</servlet-name>
<url-pattern>/TestBeanServlet</url-pattern>
</servlet-mapping>
</web-app>

But still the results are same

I m using Tomcat 5.5.
Vijay Dharap
Ranch Hand

Joined: Mar 18, 2004
Posts: 32
Have you included the right taglib reference in the jsp?

also I do not see you using any jsp tag around "${}".. how about posting your real jsp code here?


Vijay dharap,
<a href="http://dharapvj.wordpress.com" rel="nofollow">Blog</a>
Reena Nagdev
Greenhorn

Joined: Dec 27, 2008
Posts: 4
Vijay Dharap wrote:Have you included the right taglib reference in the jsp?

also I do not see you using any jsp tag around "${}".. how about posting your real jsp code here?


Thanks a lot!!!
It worked.

Here is my output:
Dog's name is: Spike



Maybe i didn't restart my Tomcat properly previously.

Thanks Christophe
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Vijay Dharap wrote:also I do not see you using any jsp tag around "${}"

I don't know what you mean. You don't need anything around EL. Same about "Have you included the right taglib reference in the jsp?". What do you mean exactly ? Taglibs have nothing to do with EL.
Vijay Dharap
Ranch Hand

Joined: Mar 18, 2004
Posts: 32
Christophe Verré wrote:
Vijay Dharap wrote:also I do not see you using any jsp tag around "${}"

I don't know what you mean. You don't need anything around EL. Same about "Have you included the right taglib reference in the jsp?". What do you mean exactly ? Taglibs have nothing to do with EL.


Hello Chris,

At least I took the EL expressions in the thread for the EL in JSTL.

Can you write EL ${..} just like that in jsp and it would work? That's new to me.

Can you point to relevant documentation / tutorial about the same?

I searched on google.. could not find much in this specific aspect..

Sorry if I really misled people.. I can delete the above post to avoid confusion..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

You're looking at an old tutorial. Here is a tutorial about JSP2.0.

Sorry if I really misled people.. I can delete the above post to avoid confusion..

Don't need to be sorry. We are all learning here
Vijay Dharap
Ranch Hand

Joined: Mar 18, 2004
Posts: 32
Christophe Verré wrote:You're looking at an old tutorial. Here is a tutorial about JSP2.0.

Amazing stuff.. I really did not know that JSP itself got so much advanced as part of JSP 2.0!

Thanks a lot Chris!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL ignored