| Author |
need help in wildcard mapping
|
rajiv shrestha
Ranch Hand
Joined: Aug 25, 2010
Posts: 30
|
|
my action class look like below:
package action;
import com.opensymphony.xwork2.ActionSupport;
public class UserAction extends ActionSupport {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@Override
public String execute() throws Exception {
message = "inside execute method";
return "success";
}
public String add() {
message = "inside add method";
return "success";
}
public String delete() {
message = "inside delete method";
return "success";
}
public String edit() {
message = "inside edit method";
return "success";
}
}
In struts.xml:
<action name="*User" method="{1}" class="action.UserAction">
<result name="success">/success.jsp</result>
</action>
this program works well with the desired output.
But i am unknown about method="{1}".
"method" attribute invokes specific method but what does the parameter "{1}" indicate?
--- need help ---
thnx in advance
|
 |
Anbarasu Aladiyan
Ranch Hand
Joined: Jun 02, 2009
Posts: 182
|
|
Value of {1} will be replaced by the value passed through *.
Also please use code tags while posting the code samples. It will be easier to read the codes.
|
A.A.Anbarasu
|
 |
Krishna Madhava
Greenhorn
Joined: Sep 21, 2007
Posts: 11
|
|
Hi,
I also having the same doubt,
So, incase if the user didnt pass the actionname for the '*" parameter in the URL then what will be passed to method={1}.
Ex: http://localhost:8080/context/User.do
here which method will be called..
Thanks in advance
|
 |
Anbarasu Aladiyan
Ranch Hand
Joined: Jun 02, 2009
Posts: 182
|
|
|
Please ShowSomeEffort. What happened when you tried.
|
 |
 |
|
|
subject: need help in wildcard mapping
|
|
|