如何将JavaBean对象作为参数传递给action?
例如我有动作(dataBean是JavaBean):
1)
public class SimpleAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private DataBean dataBean;
public String execute() throws Exception {
System.out.println("SimpleAction executing");
System.out.println(dataBean.getMinDate().toString());
return SUCCESS;
}
public DataBean getDataBean() {
return dataBean;
}
public void setDataBean(DataBean dataBean) {
this.dataBean = dataBean;
}
2)然后我想从jsp调用此操作而不是字符串参数(dataBean):
例如:
<s:url var="simple" action="simple">
<s:param name = "dataBean" value="#request.dataBean"/>
</s:url>
3)我是否需要将类型从dataBean对象转换为字符串,反之亦然?
4)是否可以在Struts2中使用这种结构?
5)请解释并且代码示例也很好