使用struts2框架产生的问题:

index.jsp:


<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<jsp:forward page="/login/login.jsp"></jsp:forward>

login.jsp:


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<script type="text/javascript">
function ini(){document.form1.loginName.focus();
}
</script>
<html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><link href="${pageContext.request.contextPath}/css/Style.css" rel="stylesheet" type="text/css"></head><body onload="ini()"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center"><table width="452" height="290" border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#FFFFFF"><table width="452" height="290" border="0" cellpadding="0" cellspacing="0"><tr><td height="74"><img src="${pageContext.request.contextPath}/images/logintitle.gif"></td></tr><tr><td align="center" valign="bottom" background="${pageContext.request.contextPath}/images/loginbg.gif"><s:form id="form1" name="form1"  action="LoginAction_home.do" target="_parent" method="post">    <table border="0" align="center" cellpadding="2" cellspacing="0"><tr align="center"><td height="30" colspan="2" style="border-bottom: 1px dotted #cccccc"><strong style="font-size: 14px;">请登录</strong></td></tr><tr><td height="30" nowrap><font color="000F60"><strong>用户名:</strong> </font></td><td><s:textfield name="loginName" id="loginName" class="text" style="width: 160px;"/></td></tr><tr><td height="30" nowrap><strong><font color="000F60">密码: </font> </strong></td><td><s:password name="loginPsw" id="loginPsw"  class="text" style="width: 160px;"/></td></tr><tr><td height="30" nowrap colspan="2"><strong><s:fielderror/><font color="red"></font> </strong></td></tr><tr><td height="30"></td><td><s:submit type="button" name="submit" value="登录" class="buttoninput"></s:submit><s:reset type="button" name="reset" value="取消" class="buttoninput"></s:reset></td></tr></table></s:form><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="30" align="center"></td></tr><tr><td height="23" align="center"></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body>
</html>

这里所填写的form表单 namespace="/login"action=" LoginAction_home.do",会造成的问题是:

  • There is no Action mapped for namespace [/] and action name [LoginAction_home] associated with context path [/itcast1109_project].

*index.jsp直接指向login.jsp,通过访问index.jsp,点击"登录",
                *结果会报错:There is no Action mapped for namespace [/] and action name[LoginAction_home] associated with context path[/]......
                *原因:index.jsp是工程目录的根目录下,导致在index.jsp页面识别不出namespace

改为action="/login/LoginAction_home.do"就可以了

There is no Action mapped for namespace [/] and action name [LoginAction_home] associ相关推荐

  1. javaweb报错There is no Action mapped for namespace [/] and action name [Login] context path [/struts]

    javaweb报错 There is no Action mapped for namespace [/] and action name [Login] associated with contex ...

  2. There is no Action mapped for namespace / and action name .

    建立一个struts2+hibernate+spring的demo,结果发现输入:http://localhost:端口号/项目名称/ 后,页面报:HTTP Status 404 - There is ...

  3. There is no Action mapped for namespace [/] and action name [] associated with context path [/dxm__s

    2015-4-3 10:23:19 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error 严重: Exception occ ...

  4. Struts2中关于There is no Action mapped for namespace / and action name的错误解决

    今天在调试一个十分基础的Struts2框架小程序时.总是提示"There is no Action mapped for namespace / and action name"的 ...

  5. There is no Action mapped for namespace[/] and action name [] associated with context path.

    There is no Action mapped for namespace[/] and action name [] associated with context path.这是一个很常见的s ...

  6. There is no Action mapped for namespace [/] and action name [test] associated with context path [...

    There is no Action mapped for namespace [/] and action name [test] associated with context path [/s2 ...

  7. 关于报错There is no Action mapped for namespace [/] and action name 。。。(两个package的name重复 T_T)

    在使用struts.xml的<include file="***.xml"></include>时,配置了两个xml文件,一直报错,查了网上不少方法,htt ...

  8. message There is no Action mapped for namespace [/] and action name [login] associated with context

    搭建struts工程出现以上问题: 1.排查关键字,xml中是不是有关键字写错 如struts2,default等 2.action 表单  一般要写成 xxxx.action  如:login.ac ...

  9. There is no Action mapped for namespace / and action name accredit.

    No result defined for action XXX and result input 这种错误的原因一般是页面的属性和action里的属性个数.名称.类型不一致造成的. 转载于:http ...

最新文章

  1. RNA-seq技术之转录组从头组装介绍
  2. springBoot 搭建web项目(前后端分离,附项目源代码地址)
  3. SAP 金属行业实施项目的GAP之Metall Balance
  4. 软件开发的N种基础武器 - 最新清单
  5. 药师帮完成1.33亿美元D轮融资,投资方为老虎环球基金、H Capital和DCM
  6. 击败李世石后,人工智能转战医疗:用大数据诊断眼科疾病
  7. 一:redis 的string类型 - 相关操作
  8. mysql bootstrap pxc_Mysql高可用之PXC
  9. 提现接口网站 php,API提现接口
  10. C#如何回到主线程,如何在委托指定线程执行
  11. Struts2学习笔记(一)--入门常见配置
  12. 更改盘符不成功_DVD光驱不读盘怎么解决?DVD光驱能刻录吗
  13. 分别用雅可比(Jacobi)迭代法和高斯—塞德尔(Gauss—Seidel)迭代法求解线性方程组(转载)
  14. 服务器互相备份不同步_详解容灾与备份,为数据安全保驾护航
  15. MySQL8的8大新SQL特性
  16. sql 备份 文件大小_预测SQL备份大小
  17. Matlab-数值计算方法作业
  18. 技嘉 B85-HD3 4590 OC 引导文件 基本完美
  19. java软件官网下载汇总——JDK,eclipse,mysql,maven,idea,Git,oracle
  20. UART和RS232/RS485的关系是什么?RS485在linux下的调试 ubuntu串口调试工具

热门文章

  1. Python编译成C语言,性能有多暴力?
  2. 使用git建立远程仓库,让别人git clone下来
  3. MySQL搭建主从复制 读写分离 分库分表 MyCat高可用
  4. html 快捷键id自动编号,Emmet的HTML语法(敲代码的快捷方式)
  5. android7.0wine乱码,Wine1.7+QQ6.4+处理中文乱码
  6. JS判断字符串是否为整数--简单的正则判断
  7. CRMEB Dockerfile文件
  8. 比较全面的MySQL优化参考
  9. linux inotifywait脚本,使用inotify/fswatch构建自动监控脚本
  10. module是什么类型_Linux驱动开发:为什么教程都不讲MODULE_DEVICE_TABLE的作用