初学struts,按照书上app02a写的程序,不知道为什么会报错。

1.web.xml
struts
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
struts2
/*
JSPs
/jsp/*
BASIC
2.struts.xml
/jsp/ProductForm.jsp
/jsp/ProductDetails.jsp
3.Product.java
package com.imjian.struts;
import java.io.Serializable;
public class Product implements Serializable {
private String productName;
private String description;
private String price;
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String execute(){
return "seccess";
}
}
启动tomcat的时候没有报错;
当我输入http://localhost:8080/struts/Product_input.action时,会得到:
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
好吧,是我买的书过时了,把web.xml改成
就好了。
已经被替换了