Question: Assuming the class LoginForm contains a String property named "password", how does the LoginAction class access the attribute called "password" in the above request? Explain why.
if you set the passord value in Formbean Already Then we can Directly call that value by using String password form.getPassword();
if u Wann use that by in Action only Means just Set the Value in action as <formName.set( Password value)> in the Form of dynaactionform after setting the value u hav to declare that in strutsconfig.xml..
if this is not Clear Just let me know i Will Send u one Example..
Choice 1 and Choice 4 both are correct. But idealy one should go for Choice 4 only adhering to struts framework. We need to type cast form object reference got in exectue method to particular required Action Form
RE: Question: Assuming the class LoginForm contains a String property named "password", how does the LoginAction class access the attribute called "password" in the above request? Explain why.Choice 1 String password = request.getParameter("passwor
If the values are set from a JSP then we need to follow the request.getAttribute() method and while revalidating the fileds the request.getParameter() method will be fired.
The reason for the above two is as follows 1. While setting the values in a JSP it is set as an argument and the same is sent to the formbean in the form of attribute. It is an attribute because we are setting the value to that particular validation method.
2. At the time of revalidation in the formbean the same value is set as a parameter. Now since we have set the attribute at the time of revalidation in the form bean it is taken as a parameter to that validation method.
I hope this gives you a better idea for your question.