• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in EL

 
babu sharath
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
In servlet I wrote request.setAttribute("test",somestringarray );
In JSP I used EL to retrive that array contents like
${test}
But in output those array contents are not coming .. in out put
${test} is coming ...

Do I have to write anything to enable EL

Regards,
Sharath
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By default EL is enabled. Make sure that you have a container like tomcat 5.x that will recognize EL. Also make sure that your web app tag looks something like this...

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

What web container are you using ? Have you disable EL in your DD ?

By the way you cant access the content of an array like that. You need to iterate through the contents with the <c:forEach> custom action.
 
babu sharath
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Thanks .. Now it is working ..
Earlier web-app tag was ...
<web-app xmlns="http://java.sun.com/ns/j2ee"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version=" 2.4">
Now I changed to what it is mentioned in the post.
It is working now ....

Regards,
Sharath
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic