• 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
I have a JSP Test.jsp

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

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" %>
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!