Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with EL  RSS feed

 
Kim Lauwers
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • 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
 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • 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
  • 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
    • 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
     
    Stefan Evans
    Bartender
    Posts: 1834
    10
    • Mark post as helpful
    • send pies
    • 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
     
    anya nav
    Greenhorn
    Posts: 4
    • Mark post as helpful
    • send pies
    • 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.
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 65828
    134
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • 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
    • 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
    • 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 ]
     
    It is sorta covered in the JavaRanch Style Guide.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!