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 [/s2d]. - [unknown location]
stucts2中错误 找不到文件路径
可能性:
structs.xml 文件(文件名一个字母都不能出错)应该放在 src文件夹下面。具体配置如下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN""http://struts.apache.org/dtds/struts-2.3.dtd"><!-- START SNIPPET: xworkSample -->
<struts><!-- extends必须写,直接或者间接继承struts-default name自定义 --><package name="struts" extends="struts-default"><!-- name是请求名称,不要写/;class对应action完全限定名=包名+类名 method: 指定处理类所触发的方法 --><action name="test" class="com.wang.struts2.Test"><!-- result是结果集 name和对应action中的方法的返回值匹配,默认是success --><result name="success">/MyJsp.jsp</result></action></package>
</struts>
配置中的extends="struts-default" 必须写不能错(当然也可以间接继承)
web.xml(在WEB-INF文件夹下) <filter-name>struts2</filter-name> 这个不能写错切记勿写成structs2
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>*.action</url-pattern></filter-mapping><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>
</web-app>
处理类(此处不多说)
package com.wang.struts2;import com.opensymphony.xwork2.Action;public class Test {public String execute(){System.out.println("hello Test");return Action.SUCCESS;}
}
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 [LoginAction_home] associ
使用struts2框架产生的问题: index.jsp: <%@ page language="java" contentType="text/html; char ...
- 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 ...
- There is no Action mapped for namespace / and action name .
建立一个struts2+hibernate+spring的demo,结果发现输入:http://localhost:端口号/项目名称/ 后,页面报:HTTP Status 404 - There is ...
- 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 ...
- Struts2中关于There is no Action mapped for namespace / and action name的错误解决
今天在调试一个十分基础的Struts2框架小程序时.总是提示"There is no Action mapped for namespace / and action name"的 ...
- 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 ...
- 关于报错There is no Action mapped for namespace [/] and action name 。。。(两个package的name重复 T_T)
在使用struts.xml的<include file="***.xml"></include>时,配置了两个xml文件,一直报错,查了网上不少方法,htt ...
- 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 ...
- There is no Action mapped for namespace / and action name accredit.
No result defined for action XXX and result input 这种错误的原因一般是页面的属性和action里的属性个数.名称.类型不一致造成的. 转载于:http ...
最新文章
- CSS中expression使用简介(转载)
- eclipse tomcat内存设置
- 【重庆】2021年下半年软考报考时间及通知
- JS原生 实现图片懒加载
- Non-resolvable parent POM
- 洛谷1052——过河(DP+状态压缩)
- 独立看门狗---STM32----HAL
- Linux系统添加永久静态路由的方法
- 2011年值得注意的5个设计趋势
- 风湿病年鉴 | scRNA-seq研究揭示骨关节炎患者的半月板退变新机制
- java属性绑定_java基础:10.1 Java FX与属性绑定
- 三层架构之初识庐山真面目
- android onscrolllistener判断到底部,android中RecycleView添加下滑到底部的监听示例
- TypeScript极速完全进阶指南-2中级篇
- TensorFlow安装教程(Windows/Linux两种版本)
- 从零实现深度学习框架——过拟合与欠拟合
- ubuntu下点击安装VMware tools,没有压缩包文件
- BGP超级失误:Verizon 搞垮 Cloudflare 和 AWS 等巨头,导致“连锁灾难性故障”
- 漫画:“排序算法” 大总结
- python使用CV2剪切图片