环境是s2sh 的
我有
package com.hardy.action;import com.hardy.bean.ProductType;
import com.hardy.servers.ProductTypeServer;
import com.opensymphony.xwork2.ActionSupport;public class ProductTypeAction extends ActionSupport { //实体bean
private ProductType pt;
//servers
private ProductTypeServer pts; public void setPt(ProductType pt) {
this.pt = pt;
}
public void setPts(ProductTypeServer pts) {
this.pts = pts;
}
public String checkName() throws Exception{
//........
}
}
我请求这个action的时候 单独http://localhost:8880/shop/manager/product/save.action?pt.name=mmmmm&pt.note=mmmmmhttp://localhost:8880/shop/manager/product/save.action?pt.name=mmmmm这两地url
前面那个action只能取到pt.note
后面这个能取pt.name不晓的是怎么回事 有两就会出现 前面的为null
我有
package com.hardy.action;import com.hardy.bean.ProductType;
import com.hardy.servers.ProductTypeServer;
import com.opensymphony.xwork2.ActionSupport;public class ProductTypeAction extends ActionSupport { //实体bean
private ProductType pt;
//servers
private ProductTypeServer pts; public void setPt(ProductType pt) {
this.pt = pt;
}
public void setPts(ProductTypeServer pts) {
this.pts = pts;
}
public String checkName() throws Exception{
//........
}
}
我请求这个action的时候 单独http://localhost:8880/shop/manager/product/save.action?pt.name=mmmmm&pt.note=mmmmmhttp://localhost:8880/shop/manager/product/save.action?pt.name=mmmmm这两地url
前面那个action只能取到pt.note
后面这个能取pt.name不晓的是怎么回事 有两就会出现 前面的为null
不行就用<s:url><s:parameter></s:url>
1.pt属性在Action中有get/set方法吗?
2.ProductType有默认构造函数?
2, 是否有默认的构造函数.
3, 试试这个 <s:url> <s:parameter> </s:url>
http://localhost:8880/shop/manager/product/save.action?name=mmmmm¬e=wwww
你这样试试能不能取到值