In struts.xml, what does the attribute \"method\" stands for in the \"action\" tag?

Answer

The method attribute tells the name of the method invoked after setting the properties of the action. This attribute can hold the name of the method or the index of the result mapping.

For example:

<action class="com.company.app.Login" method="login" name="login">
<result name="success">/success.jsp</result>
</action>
<action class="com.company.app.Login" method="{1}" name="login">
<result name="login">/success.jsp</result>
</action>

In both, the method signature is
public String login()

All struts2 Questions

Ask your interview questions on struts2

Write Your comment or Questions if you want the answers on struts2 from struts2 Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---