Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL with Java script inside a JSP

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a JSP Test.jsp

<html>
<head>
<script>
function initialize(timeStampVal) {
alert('${param.myParam}'); ---> Pops up with string 'timestamp'
<c:if test="${param.myParam=='timestamp'}"> ---> Fails
alert('${param.myParam}'); ---> Never executes
// More JS here --> Never executes
</c:if>
}
</script>
</head>
</html>

When the JSP runs it never throws any error. Since alert('${param.myParam}'); evaulates and pops up with a value 'timestamp' shows that my container supports EL.

Well since i have typed , i will post it also.
I later found that i missed the taglib directive
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Thanks
Deepak
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic