• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Struts 2 - Unable to Retrieve value of a property

 
Ranch Hand
Posts: 36
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I'm trying to retrieve the value of 6 properties in struts. But, for some values I'm getting as "0" (wrongly), but for others, I'm not getting the values, itself.

below is the code. Please, help resolve this. Find attached the "Project structure" as an Image file.

Another question - is there a way for logging values, events in struts?? (Just to check for step by step values in "ActionClass"

Thanks in advance,

ActionClass.java



Web.xml


struts.xml


index.jsp
Porject-structure.jpg
[Thumbnail for Porject-structure.jpg]
 
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


I'm trying to retrieve the value of 6 properties in struts. But, for some values I'm getting as "0" (wrongly), but for others, I'm not getting the values, itself.



So which values are you getting a 0 for and which values are you getting nothing? I will tell you that according to the JavaBean specification, getters and setters should be camel case. That is, the getter for a property named first_number should be getFirst_number.


Another question - is there a way for logging values, events in struts?? (Just to check for step by step values in "ActionClass"



If you use System.out.println(), the output should go to your web server log. Struts uses Log4j, which is much more flexible than println.
 
Palraj Jayaraj
Ranch Hand
Posts: 36
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe for the reply.

Sorry forgot to post the "Output".

But, Let me tell you, I just changed the getter and setter methods to the "Camel Case". It is working..

Thanks Buddy
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic