Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Struts 1 html form rendering and populating ?

 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a form as below




ISSUE 1 (RENDERING): page is not rendered i get a exception "Invalid argument looking up property:"



i have soled this issue by


My Question

will struts create the instance variable by its own ?

In my previous project i have not created instance variables , why now its want me to create?

 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayaraj Jaganathan wrote:i have soled this issue by


My Question

will struts create the instance variable by its own ?

In my previous project i have not created instance variables , why now its want me to create?


Struts create the instance for the UserForm, but not for the for attribute(User, Address ) in the UserForm. You've to use getters and setters for the same.
 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Struts create the instance for the UserForm, but not for the for attribute(User, Address ) in the UserForm. You've to use getters and setters for the same.


Thanks for your reply.

Please let me know is this feature not available in Struts1 ???
I hope it is available in Struts 2 !!!
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayaraj Jaganathan wrote:
Struts create the instance for the UserForm, but not for the for attribute(User, Address ) in the UserForm. You've to use getters and setters for the same.


Thanks for your reply.

Please let me know is this feature not available in Struts1 ???
I hope it is available in Struts 2 !!!

Its S1 we are taking about right ? Why the S2 comes in between ? What is the diffrence between two code snippets you provided ? One has null object wheter another is assign a valid (empty) object. You've to use setter and getter to create an valid instance for the FORM attribute.
 
Jayaraj Jaganathan
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sagar Rohankar wrote:
Its S1 we are taking about right ? Why the S2 comes in between ?


Cool !!!. It just my interest to know about the features in Struts1 and Struts 2

Sagar Rohankar wrote:
What is the diffrence between two code snippets you provided ? One has null object wheter another is assign a valid (empty) object. You've to use setter and getter to create an valid instance for the FORM attribute.


Struts don't create the instance for the attribute(User, Address ) in the UserForm.
so i coded to the instance variable.


Once again thanks for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic