• 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 property not found problem

 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I took this example from HFSJ ,as usual LOL but I got problem again.

//Person.java


------------------
//Toy.java


----------------
//Dog.java


-----------
//ToyServlet.java

----------------
toys.jsp



-----------
no problem in web.xml (I can bet )
----------------------

The problem is : javax.el.PropertyNotFoundException: Property 'name' not found on type java.lang.String

----------------------------
Solve it ;)

best regards,
omi
[ March 20, 2008: Message edited by: omi sharma ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
omi sharma,

Javaranch tip:
A lot of people (myself included) won't bother sifting through more than 3 or 4 lines of unformatted code. You took the time to add UBB code tags, which is great but it looks like you also removed all the indenting. Preserving the indenting is main reason for using UBB code tags in the first place.

You can always fix the text in your first post by clicking on the .
 
Ranch Hand
Posts: 4864
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The message is telling you that the object represented by the scoped variable "person" is actually a String object, not a Person object. If you'll look closely at ToyServlet, you will see that you actually did place a String in the request scoped variable "person", that string being "p". I suspect what you meant to do was use the Person object represented by the variable p instead.

Hopefully now you know how to fix it.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am afraid the problem is not what you told me brother.
you need to look closer the problem because I took the problem from hfsj book
(chapter 8,page 374).It's exactly the same as in the book.
p is object which I created on ToyServlet ,Person is actually string.
so please solve this ASAP.This EL has bugged me up.

by the way don't you think it could be scope problem.I did not set the scope
yet.Because as far as I know default is page ,should I need request scope. :p

please verify that too.

best regards,
omi
[ March 20, 2008: Message edited by: omi sharma ]
 
Ranch Hand
Posts: 124
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as Merrill suggested,
you should use
instead of
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can assure you that java.lang.String does not have a name property.
Look more closely at your book.
If, indeed, it is setting a string literal as the attribute, then you should also check that book's errata site to see if it was a misprint.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by omi sharma:
you need to look closer the problem...so please solve this ASAP


Actually, I don't need to do anything, as I'm just here in the forum to help with questions and for my own fun and enjoyment. Isn't this fun?
[ March 20, 2008: Message edited by: Merrill Higginson ]
 
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
Demanding that other people solve your problems for you is hardly the most effective strategy for obtaining help. I strongly suggest that you rethink your approach.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry friends,I had no intention to hurt your feelings.
you are absolutely right,you need not do anything for me.
I should have said,'I beg you to solve my problem.'
Sorry for my air of manager. LOL

Actually at that time ,I was not in the situation to think as I am taking
too much tension these days.

'you need to ' is dangerous while you are asking for help.
This is the second time when someone hit me for using that word. LOL

And as to the problem ,you are absolutely right.I did not notice correctly.

'you need to' is quite demanding isn't it.? :p

sorry once again.

best regards,
omi
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic