• 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

Problem with EL

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to use EL in my JSP pages, (I'm studying for SCWCD) but I can't make my EL work :s

web.xml


Servlet FirstEL

FirstEL.jsp


Output in FireFox

Dog's name is: ${person.dog.name}



So my EL doesn't work, I have nowhere disabled the EL and I have inlcluded serlvet.jar and jstl.jar

Thx
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kim,

I think the problem arises beacause, you did not import the required Dog class which of the property of the Person.

Hope this will work.
 
Kim Lauwers
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I have this:

En the output stays the same, I don't get an error the EL is just not performed.

Do I need soms extra imports of jars or so?
I have now:
  • servlet.jar
  • jstl.jar
  • standard.jar


  • Thx

    [EDIT]I don't know if it's important but I'm using Tomcat 5.0[/EDIT]
    [ October 26, 2005: Message edited by: Kim Lauwers ]
     
    Kim Lauwers
    Ranch Hand
    Posts: 31
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator


    [EDIT]I don't know if it's important but I'm using Tomcat 5.0[/EDIT]



    I think this is my fault,
    I used to use Tomcat 5.0 and IntelliJ

    Now I use Tomcat 5.5 and Eclipse and it works fine.

    thx
     
    Bartender
    Posts: 1845
    10
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    The problem was with your web.xml.
    Unless your web.xml file is declared as being version 2.4, then it will disable EL by default.

    See here for the correct format:
    http://faq.javaranch.com/view?ServletsWebXml
     
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,
    I have the same problem as that of Kim.(i.e, I get my EL expression as the view(i.e ${person.dog.name})! instead of the name of the dog...
    I really wonder if issue is because of the fact that I am using Tomcat 5.0 version?
    I believe that it is a stable version and it supports EL.

    Also, like Stefan mentioned,I tried changing the DOCTYPE to :


    Now, it gives an error 404..i.e:

    (t is my webapp name)
    I was wondering if anyone could help me out..

    Thanks in advance!!
    Regards,
    Anya.
     
    Sheriff
    Posts: 67746
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    That probably means that the web app never started up because of an error in the web.xml file. Look in the logs to try and find out what the specific error was.
     
    anya nav
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    hi,
    Thanks Bear Bibeault..
    My jsp,servlets are now interacting fine.I actually used a UML tool
    to generate class diagram.And it apparently seems to have inserted
    some extra code into my servlets and beans..Once I deleted it,
    I was able to get the EL running!!!
    Another thing was I had not passed Dog object to Person!!!( says:

    I am not sure if my problem(i.e EL code being displayed on client side)
    had anything to do with the extra UML generated..
    Just if this might help anyone out there...

    Again, thanks a lot Bear, for your suggestion..
    Regards,
    Anya
     
    anya nav
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Oh, one more thing..
    EL seems to be working fine with

    above code in my web.xml !

    Regards,
    Anya
    [ October 27, 2005: Message edited by: anya nav ]
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic