web.xml
部份:
struts2
org.apache.struts2.dispatcher.FilterDispatcher
struts2
/*
struts.xml
/st.jsp
/two.jsp
Hello.java
package pkone;
import com.opensymphony.xwork2.ActionSupport;
//
public class Hello extends ActionSupport{
/**
http://127.0.0.1/test/he/hello.action 来来去去都是404
http://127.0.0.1/test/webroot/ ~~却能正常访问
404一般是访问的资源不存在,检查自己的url是否正确。
推荐去看下web服务的资源路径和绝对路径的关系。
500一般是页面出现问题,比如jsp编译出错。
WebRoot目录下是否存在/st.jsp。请注意这个
如果路径是全路径那么是/开头,如果是相对路径那么请不要/开头,所以你要看看你的result那个跳转页面是否是根目录下的。
还有./代表当前目录,../代表上一级目录。
struts2是*.action,请严格按照规范来,那样出现错误的几率比较小。