相关文章
更多最近更新
更多There is no Action mapped for namespace / and action name register.
2019-03-25 13:34|来源: 网路
jsp文件:
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Index Page</title> </head> <body> <form action="register.action" method="post"> <select name="name"> <option value="ChinaFuction">ChinaFuction</option> <option value="UsaFunction">UsaFunction</option> </select> <input type="submit" value="确定"/> </form> </body> </html>
struts-xml文件:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <include file="struts-default.xml" /> <package name="struts2" extends="struts-default" > <action name="register" class="com.fenfen.FuctionRegisterAction"> <result name="success">/success.jsp</result> </action> </package> </struts>
web-xml文件:
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>myNewProj</display-name> <!-- 定义Struts2的FilterDispathcer的Filter --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <!-- FilterDispatcher用来初始化struts2并且处理所有的WEB请求。 --> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>/indexfirst.jsp</welcome-file> </welcome-file-list> </web-app>
查了很多,原因最多是struts-xml文件放错位置,还有就是struts-xml文件配置错误。我的struts-xml文件放在了src文件夹下,应该没有放错地方,但是<?xml version="1.0" encoding="UTF-8"?>头文件报错。请大牛帮我看看配置有没有错误,O(∩_∩)O谢谢
能正确出现indexfirst.jsp页面,但是单击确定的时候报错。
相关问答
更多-
如果您在struts.xml文件中遇到问题,实际上会出现此异常。 从中更改您的struts xml结果位置
/user_add_success.jsp 至user_add_success.jsp 或者尝试将jsp文件中的操作名称更改为user.action。但我确信上面的操作会为你完成。由于struts.xml文件中的问题,肯定会发生这种情况。检查通过。 This Exception Actually comes If you Hav ... -
无法使用简单的Action [2022-03-08]
如果因为传递null而没有使用状态对象,那么可以对Register方法进行另一次重载: public CancellationTokenRegistration Register( Action callback, bool useSynchronizationContext ) 并简单地这样调用它: cts.Token.Register(new Action(() => { Console.WriteLine("Hello World"); }), true); 如果你想坚持你的delegate你也可以 ... -
我想在localhost上触发一个动作:8080 / appname / namespace / ie namespace slash 斜杠后应该是动作名称,如果它是空的,你应该配置空动作名称。
/blank.ht ... -
因为/TestStruts是部署应用程序的上下文路径。 它与包中的命名空间具有相同的路径。 尝试 http://localhost:8080/TestStruts/TestStruts/test.action 当URls从struts标签渲染时,它试图找到相应的动作配置。 如果没有找到配置,则发出警告。 Because /TestStruts is a context path at which deployed your application. It has the same path as name ...
-
我认为你需要指定命名空间。 你试过像: @Action(value="/loginAction") I added the next 2 lines in my struts.xml in order to fix the problem:将下面的空行为添加到"/"软件包名称空间中的struts.xml文件中,当您只尝试访问您的url时(如appid.app.com),它将显示index.html,并且它不会显示错误。 通常它会添加一个空白动作,应用程序引擎会将空白动作重定向到欢迎文件。
index.jsp ...引擎正在调用GetNewClosure() ,这对它来说是一件好事。 当我运行上面的命令时,我得到的输出只有Value: [void](new-event -sourcei 'foo')但后来我全局声明$y = 25并再次运行[void](new-event -sourcei 'foo') ,输出为Value: 25 。 然后我再次更改了它的值, $y = 38 ,并再次运行该事件: Value: 38 。 如果你想要的是在创建动作时烘焙$y的值,那么一种方法是创建scriptblock,使$y的值成为文字 ...在web.xml中,在servlet url模式中添加.extentionPunchoutOrder /PunchoutOrder.srl 与以下问题相关的问题:没有为与上下文路径关联的命名空间和操作名称映射的操作 如果使用url调用操作,请确保将此URL映射到struts配置。 要解决url映射问题,可以使用config-browser插件。 只需将此插件添加到您的项目依赖项中,当它部署时,您可以访问一个网站,显示运行时配置,并使用可用的URL来调用该操作。 例如,如果您在端口8080上本地运行Tomcat并在context部署您的应用程序,那么您可以访问该插件的URL http://localhost:8080/[context]/conf ...无法找到行动或结果(Could not find action or result)[2023-01-17]
动作名称[]和命名空间[/]没有配置。 这是个问题。 要解决此问题,您应该添加配置。 假设您在根文件夹中有一个index.jsp文件。 使用无操作结果,您可以重定向到此页面。 ... There's no configuration for action nam .../index.jsp