I am new in struts and learning it. My question is how struts map request parameter with action instance variable. For Example i have one login form that take username and password. Now it sends request to LoginAction. How this action class will get username in username instance variabel and password in password variable. In servlet we use request.getParameter() method and assign value to particular variable.
I am new in struts and learning it. My question is how struts map
Share
in struts2 we use
Interceptor, in this case struts2 will set the params for you withparaminterceptor, you just have to config your interceptor stack (or you just use the default-stack). here is the link to Interceptor, if you are very fresh in struts2, just use the default configuration and take a feel.example:
and
action class:
configuration:
in this case
myFieldwill be set automatically by interceptor.