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 doubt in Struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets 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: 30068
    
149

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.
 
Don't get me started about those stupid light bulbs.
 
subject: doubt in Struts application
 
Similar Threads
JspTranslate: End of content reached while more parsing required: tag nesting error?.
Missing message for key
Error:No valid collection specified for size tag
problem with action mapping
server encountered an internal error ;while running application