Let take an example to understand methods in Action mappings
struts.xml
Here our action is mapped for same action class for two different methods, on place of execute() method we are calling takeForm() and addChart() methods on same action class for crossponding action names.
we can also perform above task with wildcards
struts.xml (With Wildcard)
The part of the URI matched by the wildcard will then be substituted into various attributes of the action mapping and its action results replacing {1}.
For the rest of the request, the framework will see the action mapping and its action results containing the new values.
More Struts Topics :
struts.xml
Here our action is mapped for same action class for two different methods, on place of execute() method we are calling takeForm() and addChart() methods on same action class for crossponding action names.
<action name="takeForm" class="blog.webideaworld.in.takeAction" method="takeForm">
<result name="success">success.jsp</result>
<result name="failure">error.jsp</result>
</action>
<action name="addChart" class="blog.webideaworld.in.takeAction" method="addChart">
<result name="success">success.jsp</result>
<result name="failure">error.jsp</result>
</action>
we can also perform above task with wildcards
struts.xml (With Wildcard)
<action name="*" class="blog.webideaworld.in.takeAction" method="{1}">
<result name="success">success.jsp</result>
<result name="failure">error.jsp</result>
</action>
The "*" in the path
attribute allows the mapping to match the request URIs with same action and method name.The part of the URI matched by the wildcard will then be substituted into various attributes of the action mapping and its action results replacing {1}.
For the rest of the request, the framework will see the action mapping and its action results containing the new values.
More Struts Topics :
- How to Set Struts2 Environment for Eclipse with Oracle 10g Express Edition
- Simple struts2 program with Eclipse & Apache Tomcat Server
- Login Using Struts2 and Eclipse
- Database Access using Struts2,Eclipse and Oracle
- Basic form Validation using Struts2 Framework with validate() method and ActionSupport class
- Validation using Struts2 Framework and XML file on Radio button and DropDownList with Eclipse
- Validation using Struts2 Framework and XML file with Eclipse Indigo
- AJAX validation using Struts2 Framework and XML file with Eclipse Indigo
- Session Tracking using SessionAware Interface with Struts2, Oracle Database and Eclipse IDE
- Action Wildcards with Struts2
- How to Configure methods in Action mappings with or without Wildcards using Struts2
- Store and Retrieve Numeric, Alphanumeric and Blob (Image) data with Struts2, Oracle 10g XE and Eclipse Indigo as IDE
- How to use Struts2 Iterator tag to get Users Details with Oracle 10g XE and Eclipse
- How to iterate user details through ArrayList with Iterator tag in Struts2 using Oracle 10g XE and Eclipse
- How to upload Multiple Files- Images (blob data) with enctype="multipart/form-data" in Oracle Database using Struts2, JDBC and Eclipse IDE
No comments:
Post a Comment