File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how does a jsp know what method in the actionform to send data to? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how does a jsp know what method in the actionform to send data to?" Watch "how does a jsp know what method in the actionform to send data to?" New topic
Author

how does a jsp know what method in the actionform to send data to?

protik ahmed
Greenhorn

Joined: Mar 21, 2010
Posts: 15
ok, I created a text box with property called creditnumber. I also created a get method in my actionform called getcreditnumber().

The set method was called setcrednumber(String creditnumber). forgetting that I had set the property to creditnumber in the jsp page, I renamed the get method to getcrednumber() to make it more similar to the set method. After compiling and refreshing the page, I get an error on the page that there is no getter method for that property. After renaming it back to getcreditnumber, it worked again. So can someone explain how a jsp page knows which method to send the data to. Why did it only pop an error for not naming the get method correctly, when the set method is not named in that format.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Follows JavaBean rules.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how does a jsp know what method in the actionform to send data to?
 
Similar Threads
Struts: ActionForm does not contain user data
get the value of checkbox
Problem with redirect after validation
setting / accessgin Java Bean between page and servlet.
Error no getter method for property BEAN