This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes doubt in Struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "doubt in Struts application" Watch "doubt in Struts application" New topic
Author

doubt in Struts application

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi i'm new to struts.I'm just trying to create one application.

search.jsp
==========


Can anyone please let me know how the setname and set ssnum as there is no call for setName() and setSsNum().

Can anyone please tell where it is being set?

Thanks in Advance.


[/CODE]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30392
    
150

Originally posted by Jay Shukla:
Can anyone please let me know how the setname and set ssnum as there is no call for setName() and setSsNum().

Can anyone please tell where it is being set?

Struts automatically calls setters for the form fields. So "name" calls "setName" and "ssNum" calls "setSsNum".


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Hi Jeanne,

Thanks for your valuable reply!!!

But how struts will know that ssNum is being(will be) set setSsNum() method as it does not match with property name in JSP.

I mean to say is in .jsp property name is ssNum where as in SearchForm it is setSsNum().

Please help mein clearing above concept.

Thanks in Advance.
Anil Mundra
Greenhorn

Joined: Nov 14, 2008
Posts: 21
hi,
as you wrote..............
I mean to say is in .jsp property name is ssNum where as in SearchForm it is setSsNum().

Here the concept is that the property name which is given in jsp file i.e. ssNum will be autometically retrived in bean class in the variable with same name.

Now I think you are confusing in it:-
In jsp property name ssNum
In Bean class variable name ssNum

Mean both are same

But the standard syntax of getters and setters is
setSsNum and getSsNum
Here we have to use the first letter as capital. So these above two method works for ssNum.

Now I think it is clear to you.........
Cheers
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
Thanks a lot Anil!!!

Now i'm clear with the concept.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in Struts application