Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How Struts will identify Class (with get / set methods) associated with it

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I amd new to struts and just reffering Struts book of Wrox publications. It is Employe Management application and they have explained that application. It has all the functionality Add/ Delete/ Edit etc. Each JSP page has its own Form Bean classes and on top of that there is one Common class called Employee which has get and set methods of the fields of the tabels.

For the Employee Class they have explaned that this class's object will hold the data of individual employee.

But i do not see how flow from one JSP will pass to this Employee class so thaty values entered by user will be set to the setter method using Reflection. Because in struts-config.xml Form Beans are associated with Each different Action classes and JSP.

Could you help me in understanid Above Concept?

Sorry if the Subject line looks wiered.

Thanks in Advance.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its based on the URL that is sent from the browser to the server. So if the browser sends a request to http://<yourserver>:<yourport>/<yourContext>/SomeAction.do, Then the struts-config.xml will be checked for an action named "SomeAction". If that action is found then the name attribute of that action will be used to find the class of the form to be used.

Hope this helps
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic