I want to pass a value in action when it is called using struts1 configuration file. I have create a form bean with following property
public class MyForm ex
Struts 1.3 DTD says
The "set-property" element is especially useful when a custom subclass is used with , , , or elements.
Create Subclass of ActionMapping with properties you would like to inclide
public class CustomActionMapping extends ActionMapping {
private String task;
public String getTask() {
return task;
}
public void setTask(String task) {
this.task = task;
}
}
configure the custom action mapping in struts-config.xml
get the value of task in doGet/doPost method your Action class
CustomActionMapping cam = (CustomActionMapping) mapping;
String task = cam.getTask();
hope this helps you.