Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Expression Language is not working in Jsp Tags

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Jsp page and we set the isElIgnored="false" in the page
directtive of the page.
I also have a tag file that we are using. When we run it, the tag file does
not evaluate my el expressions, but prints them as it is. However, this does not happened when i used scriplet expression worked fine.
When I try to include the isElIgnored page directive in the tag file, it
errors out.
1) should I be able to include the isElIgnored page directive in my tag
file, if I have it in my jstl page??
2) If I should not, then how do I get the el evaluator to evaluate my el
expression in side the tag file??

Iam just trying the example in the Head First Servlets and Jsp book.
---------------------------------------------
Here is my JSP code
<%@ page isELIgnored="false"%>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags"%>
<html>
<body>
<myTags:header subTitle="${param.name}"/>
</body>
</html>
---------------------------------------------
here is my header.tag file

<%@ attribute name="subTitle" required="true" rtexprvalue="true"%>

<em><strong>${subTitle}</em></strong><br>
<em><strong><%=subTitle%></em></strong><br>
---------------------------------------------
input :
name=abhishek (html)
output:
${subTitle}
abhishek
----------
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your web app is set up correctly, and you are using a JSP 2.0 engine, you should never need to use isElIgnored.

Please see the JSP FAQ for info in setting upi your web app correcetly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic