我们在Tomcat 9上使用Struts 6.2,并将所有.action扩展映射到操作,例如save-user.action映射到正确的动作. Web应用程序需要处理此路径参数(路径变量)ex:save-user.action/name/joe/age/20.如您所见,参数是通过URL路径发送的.呼叫者不是浏览器. 有什么办法可以配置支撑杆来处理此URL并将其映射以纠正操作? 解决方案 我们使用的是judent-plugin,似乎我们应该在支撑滤器过滤器之前获得/my.action/param1/value1 url.将其更改为有效的url/my.action?param1=value1,然后让Struts完成其余的工作. 自己做的并不容易,幸运的是,有一个解决方案可以在支撑滤器前使用Urlrewrite过滤器.请参阅 为什么翻新URL在Struts 2 中不起作用: 如果放置 tuckey urlrewrewrite how-to how to ho
以下是关于 action-mapping 的编程技术问答
有人可以解释动作映射器在支撑杆2? 中的作用 解决方案 ActionMapper接口在Struts2框架中是从请求的URL提取映射. 给出HttpServletRequest时,ActionMapper可能会返回null如果没有操作调用请求匹配,或者它可以返回 ActionMapping class 描述了该框架对 try> try> try> try> try> try> try> try> try> try> trib> . 您可以阅读有关此功能的更多信息在这里. 第一个方法返回A 映射到尝试,它不能保证将执行此操作. 操作映射器返回的ActionMapping如果有与此映射相对应的操作配置,则包含所有必要的信息,以调用操作. 可用. 该接口的不同实现可用于覆盖将URL映射到struts2中的操作的默认行为.
下午好, 我意识到这个问题已多次问过,但是这些问题主要是由于将struts.xml文件放置在不正确的地方或错误的路径名称或其他内容的人引起的. 我遵循了Struts 2网站的教程HTTP Status 404 - There is no Action mapped for namespace [/] and action name [hello] associated with context path [/basic_struts]. 我正在使用Maven作为我选择的构建工具 我的struts.xml文件位于WebContent文件夹的根部, 在WEB-INF\classes文件夹中. 以下是我的struts.xml文件的结构:
问题 当我运行项目并尝试运行 时 ERROR Dispatcher Dispatcher initialization failed Unable to load configuration. - bean - jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%208.5/wtpwebapps/Struts2Test/WEB-INF/lib/struts2-gxp-plugin-2.5.22.jar!/struts-plugin.xml:27:162 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) and more... http://http://localhost:8081/struts2test/tes
我知道还有其他几个有同样错误的线程,但是请相信我,其中没有帮助我解决了我的问题. 我有一个使用Struts2版本Struts-2.3.16和Hibernate构建的Web应用程序. 我的问题是,在我的应用程序中,我有struts.xml,因为它的尺寸很大,所以我将其分为三个XML文件.一个是main struts.xml,其中包含两个包含标签,该标签指向同一应用程序的两个不同的strtus-xxx.xml文件.我的问题是,只有一个Struts-xxx.xml正在起作用,而我在第二个XML文件中写的操作不起作用.如果我的应用程序试图指出第二个XML文件中提到的任何"动作",则未被识别. 这是我的 struts.xml代码
我正在尝试在Netbeans 7.2.1中的Struts 2.3.16上使用第一个应用程序.它显示输入URL -http://localhost:8080/TestStruts/Test.action的以下错误(有一个Test.jsp页). WARNING: Could not find action or result: /TestStruts/Test.action There is no Action mapped for namespace [/] and action name [Test] associated with context path [/TestStruts]. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) at org.apache.struts2.impl.StrutsActi
当我为应用程序设置weblogic.xml context-root时,在Struts 2中的包装空间是什么? ? ex: 我设置 /home/app/exec 我使用以下URI访问我的应用: localhost:8081/home/app/exec/index.html 设置 localhost:8081/NameOfMyApp/index.html 另一方面,我知道在struts2动作名称空间映射到文件夹结构中. 以下链接中的示例:,如果ServletContext不是我的应用程序的名称,那么该情况的正确名称空间是什么,而是context-root? 解决方案 名称空间是在上下文路径和动作名称之前计算的部分.另一方面,名称空间是包含属于该名称空间的操作的软件包的属性.默认操作映射器正在使用两个属性来查找"命名空间和操作名称"的操作配置. For detailed explana
如果我删除Struts2应用程序中的.action扩展名,我会有问题.我把它放在我的struts.xml中: 除了在索引页面中,该应用程序正常工作.我在web.xml中有: index.jsp 当我访问http://localhost/myApp/时,我会收到以下错误: There is no Action mapped for namespace [/] and action name [index.jsp] associated with context path [/myApp]. - [unknown location] 但是,如果我访问http://localhost/myApp
我在Stackoverflow上浏览了所有类似的Q,但对不起,这无济于事.我所有的主要区别在于,我在错误消息中获得了空的动作名称.谷歌搜索没有帮助:(希望有人可以提示在哪里寻找问题的根源.THX Error: HTTP Status 404 - There is no Action mapped for namespace [/] and action name [] associated with context path [/LoginApplication]. -------------------------------------------------------------------------------- type Status report message There is no Action mapped for namespace [/] and action name [] associated with context path [/Login
我有一个带有多个模块的Maven项目.在四个模块中,两个是Web模块. 这是结构. MyProject | |__ api | |__ commons | |__ web_child | |__ web_main web_main模块是主要的模块,也可以包括web_child模块. web_child模块结构是 web_child | |__ src/main/java //java action classes and all |__ src/main/resources | |__ struts-config.xml | |__ WEB-INF |__ JSP Pages web_main模块结构是 web_main | |__ src/main/java //java action cla
本网站不允许用户向他们的教程提出技术问题,我认为这是损坏的: http://www.mkyong.com/misc/misc/misc/misc/misc/howhow -to-use-mkyong-tutorial/ 我正在使用: Maven:3.2.1 tomcat 7 Java 1.7 Eclipse:Luna版本(4.4.0) 我收到此消息: WARNING: Could not find action or result There is no Action mapped for namespace [/] and action name [] associated with context path [/Struts2Example]. - [unknown location] 除非我输入完整的URL,否则我永远无法进入login.jsp页面.但是即使那样,当我单击"提交"按钮时,它也不会转到welcome_user.jsp页面.
我是Struts 2的新手,我一直在关注Struts 2(Koushik)的视频教程.我创建了Struts.xml,动作类和JSP与教程中创建的相同.但是它给出以下例外. 例外: Jan 13, 2014 9:30:48 PM org.apache.struts2.dispatcher.Dispatcher warn WARNING: Could not find action or result: /Struts2Starter/getTutorial.action There is no Action mapped for namespace [/] and action name [getTutorial] associated with context path [/Struts2Starter]. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(Defaul
我正在使用支撑杆和支柱2.x,当我试图从Struts 2表格上提出行动课程时,我的异常都不在. . File: org/apache/struts2/impl/StrutsActionProxy.java Line number: 69 Stacktraces java.lang.NullPointerException org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:185) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63) org.apache.struts2.impl