struts2为什么无返回结果???
product.jsp
<body>
<s:form action = "product">
<s:textfield name = "product.productName" label = "product name: "/><br>
<s:textfield name = "product.productPrice" label = "product price: "/><br>
<s:textfield name = "product.productCount" label = "product count: "/><br>
<s:submit value = "submit"/><br>
</s:form>
</body>
productdetail.jsp
<body>
product1 name: <s:property value = "product1.productName"/><br>
product1 price: <s:property value = "product1.productPrice"/><br>
product1 count: <s:property value = "product1.productCount"/><br>
product2 name: <s:property value = "product2.productName"/><br>
product2 price: <s:property value = "product2.productPrice"/><br>
product2 count: <s:property value = "product2.productCount"/><br>
</body>
ProductAction
package com.demo.action;
import com.demo.bean.Product;
public class ProductAction {
private Product product;
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public String execute() throws Exception{
return "success";
}
}
struts.xml
<action name = "product" class = "com.demo.action.ProductAction">
<result name = "success">
/productdetail.jsp
</result>
</action>
------解决方案--------------------你能说清楚点你的问题吗
------解决方案--------------------你product没实例化呀,没内容当先不会显示东西了。