• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic