struts.xml
/result.jsp
/{1}.jsp
HelloWorldAction.java
package com.imooc.action;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorldAction extends ActionSupport {
public String execute() throws Exception{
System.out.println("执行action");
return SUCCESS;
}
public String add(){
System.out.println("add");
return SUCCESS;
}
}
http://127.0.0.1:8080/HelloWorld/helloworld_add.action
HTTP Status 404 - There is no Action mapped for namespace [/] and action name [helloworld_add] associated with context path [/HelloWorld].
报这个错误。。我明明是按照教程的写的啊?哪里出错了?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
namespace是不是应该为/HelloWorld下划线改成中横线试试, 这个框架BUG众多,注意安全。