• 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

all properties of domain class USER get displayed in JSP correctly but the userID does not display.

 
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am facing a strange Issue. I have a User Object with properties (userId,userName etc). In action class I am able to display the properties of user Object but in the JSP page (on result success), I am not getting any user Id. It is displaying everything each of the User properties except the UserId.If I check in the debugger in action class it is showing userId with some value(E.g 8). But in JSP it does not display.All other properties display fine. Please advice.


Action class




User.java






JSP page.




In JSP page everything displays fine except the userId.

thanks.

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The getter/settter for userId should be getUserId()/setUserId(). Struts uses reflection to look up the methods and expects them to be named according to the JavaBeans Specification (see section 8.3.1).
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..


The getter/settter for userId should be getUserId()/setUserId(). Struts uses reflection to look up the methods and expects them to be named according to the JavaBeans Specification (see section 8.3.1)



If we see the User class I have shown above , the userId has been set using the same way you have described:



Is there any issue with the above.If so please advice.
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java is case sensitive. getUserId is not the same as getuserId
 
Monica Shiralkar
Ranch Hand
Posts: 2925
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked. Thanks a ton because I was not able to find the mistake even in debugger. Other errors one can find by debugging but such a mistake I wasnt able to find even in debugger.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic