Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EL not being evaluated inspite of Deployment Descriptor version 2.4 and tomcat version 5.5  RSS feed

 
nidhivel raja
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am reading Head First Servlets 2nd edition,In the JSP elements topic(chapter 7) there's a table that displays the status of EL evaluation(page 327).From the details given i understand,that if both the DD configuration and Page directive are unspeciifed for EL evaluation then El expresions will be evaluated.

I created a simple web application from the same book, where i have specified the version of web.xml as 2.4(My Tomcat version is 5.5) but still the El is not being evaluated
Following is my web.xml




My form.html
<html>
<h1 align="center">Beer Selection Page</h1>
<form method="POST" action="SelectBeer.do">
Select beer characterstics


Color:
<select name="color" size="1">
<option value="light">light</option>
<option value="amber">amber</option>
<option value="brown">brown</option>
<option value="dark">dark</option>
</select>



<center>
<input type="SUBMIT">
</center>
</form></body>
</html>



My Servlet BeerSelect.java



Finally my result.JSP

<html>
<h1 align="center">Result Page</h1>


Color of life as follows:
${requestScope.coloroflife} is yours!!!




<center>
<input type="SUBMIT">
</center>
</form></body>
</html>



When the user selects the beer choice and submits the form ,the selected result is forwarded to the result jsp with the attribute in requestScope.
Inspite of version of the DD 2.4 my EL is not being evaluated,I dont know the reason for this, Given the condition that both the page directive and DD configuration are unspecified,as per the book the El should be evaluated.Can anyone please help me in this issue.? Thank you in advance

ps:I browsed through other topics in the same forum regarding this problem ,and found that such problems arise due to version mismatches,but in my case i think i have already set my version as 2.4 .

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than the complicated code, create a JSP that contains nothing but: ${3+4}

Does it display 7 or the source?
 
nidhivel raja
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,

Thanks for your reply.i did as you advised i restarted my server as well as PC,I even cleared my cache in the browser.Now i am able to get the desired output as 7!!! :D

I think the earlier problem occured because of cache pages in the browser,anyways thankx a lot Bear:D
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!