您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Java >> HTTP Status 404 - There is no Action mapped for namespace / and action name logi

HTTP Status 404 - There is no Action mapped for namespace / and action name logi

来源:网络整理     时间:2016/7/25 21:51:11     关键词:

关于网友提出的“ HTTP Status 404 - There is no Action mapped for namespace / and action name logi”问题疑问,本网通过在网上对“ HTTP Status 404 - There is no Action mapped for namespace / and action name logi”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: HTTP Status 404 - There is no Action mapped for namespace / and action name logi
描述:

错误提示:HTTP Status 404 - There is no Action mapped for namespace / and action name login.
type Status report
message There is no Action mapped for namespace / and action name login.
description The requested resource (There is no Action mapped for namespace / and action name login.) is not available.
--------------------------------------------------------------------------------
Apache Tomcat/6.0.20
下面上代码:
web.xml


re

index.html
index.htm
index.jsp
default.html
default.htm
default.jsp


struts2
org.apache.struts2.dispatcher.FilterDispatcher


struts2
/*


struts.xml

    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
    
    
    
     /success.jsp
     /fail.jsp
    
    
    

loginAction.java
package example;
public class loginAction {
private String usename;
private String password;
public void setPassword(String password) {
this.password = password;
}
public String getPassword() {
return password;
}
public void setUsename(String usename) {
this.usename = usename;
}
public String getUsename() {
return usename;
}
public String execute() throws Exception{
if(getUsename().equals("admin")&&getPassword().equals("pass")){
return "success";
}
else{
return "fail";
}
}
}
index.jsp
<%@ page language="java" c/>

密码:






解决方案1:

试试

namespace问题,要加入url的

解决方案2:

好经典的错误啊.我的 namespace=""

解决方案3:

好像知道是怎么回事了:
楼主要用struts 2的标签呀:

改成:
 等等...

解决方案4:

试下加上应用名:
"//login"

解决方案5:

还有就是要把:
 
 改成:  

解决方案6:

这是一个关于如何理解struts 2的namespace的问题:
看了一下可以注意两个地方:
1. 要将
   改成:
2. 在浏览器输入url的时候要用:http://xxxx/example/login.action

解决方案7:

路径问题

解决方案8:

There is no Action mapped for namespace / and action name login.
路径错误了


里面的path呢
好久没用过Action了 不知道说的是否正确  

解决方案9:

 

解决方案10:


试试


以上介绍了“ HTTP Status 404 - There is no Action mapped for namespace / and action name logi”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2922226.html

相关图片

相关文章