Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

c:forEach tag  RSS feed

 
tarun bansal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I had written a servlet to set the attribute as follows:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;



and the code for forEach.jsp is :



but instead of the complete table i am getting the following out put:

Movie List :

${movie}


Can you tell me where am i wrong?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL may not be enabled. Maybe you're using Servlet 2.3.
If you can use 2.4, check how to configure web.xml here :
http://faq.javaranch.com/view?ServletsWebXml

This will enable EL by default.
 
tarun bansal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot

Indeed it is the problem with EL enabling
after adding following lines to wb.xml it is working

<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<el-enabled>true</scripting-enabled>
<scripting-enabled>true</scripting-enabled>
</jsp-property-group>
</jsp-config>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!