• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get EL working

 
Harish Yerneni
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ref p366 HFSJ

When I type ${person.dog.name}, I am getting the same thing printed out in my jsp. Any suggestions?

Thanks,

Harish
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Check to make sure that you don't have a page directive with isELEnabled="false" or an el-enabled="false" in the deployment descriptor.

both of these will cause el script to be treated as static text, which is what you are seeing.

HTH

Mat
 
Harish Yerneni
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not using web.xml for accessing the page. Here is my code in the testbean.jsp(URL: http://localhost:8080/ch8/testbean.jsp)

<jsp:useBean id="pers" class="foo.Person" scope="request" />
Dog's name is <jsp:getProperty name="pers" property="dog" />
Dog's name is: ${pers.dog.name}
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add rhis line to your JSP.

<%@page isELIgnored="false"%>
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep,

Sorry I got the directive wrong.
Thanks for correcting me.

Mat
 
Harish Yerneni
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys. It worked.

I read that EL is activated by default. It looks like it isn't. Any thoughts?

Thanks,

Harish
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it depends upon your tomcat.
Latest version supports EL enabled by default...

correct me if am wrong
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic