aspose file tools*
The moose likes Struts and the fly likes Problem in Struts 1 html form rendering and populating ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in Struts 1 html form rendering and populating ?" Watch "Problem in Struts 1 html form rendering and populating ?" New topic
Author

Problem in Struts 1 html form rendering and populating ?

Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Jayaraj Jaganathan
Ranch Hand

Joined: Jun 29, 2009
Posts: 70

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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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

Joined: Jun 29, 2009
Posts: 70
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Struts 1 html form rendering and populating ?