• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with using EL in JSP

 
kalyani bhadekar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying EL with :

In the output it should print the value of 'x' as 3 but it's printing

The EL expression for x = ${x}.

Am I making a mistake somewhere? Please let me know.

Kalyani.....
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this FAQ. Pay attention to how web.xml is supposed to be written.
 
kalyani bhadekar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using apache-tomcat-5.5.27.
My web.xml appears like:

Still The output is:

I am unable to understand the reason.
Regards,
Kalyani...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still The output is:

It's better than your first post, as the expression was correctly evaluated. You have declared a variable x in a scriptle, but it does not exist in any scope.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
christophe means that,

set value in servlet(anyscope),example, request.setAttribute ("key","christophe verre")

and forward it to the jsp . in that print like --> value:${key}

and also whether you give this line in your jsp?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Hope this helps
[ December 24, 2008: Message edited by: seetharaman venkatasamy ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and also whether you give this line in your jsp?

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

He is not using JSTL here, so it's ok without it
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe and Marry christmas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic