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
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="" %>
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic