问题标签 [struts2-convention-plugin]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
java - 如何设置基础包以扫描子包以执行操作?
我如何告诉 Struts 2 约定插件扫描一个包的所有子包。我试过这个
和这个
但他们不工作。我的动作以"Controller"
后缀结尾。有人知道怎么做吗?
这是我的struts.xml
:
和一个动作:
java - struts2 约定插件依赖
我有一个运行良好的项目。我想尝试 struts 2 中的注释,所以我将约定插件 jar(2.3.14.2) 与其他 struts2 jar 一起添加到我的 WEB-INF/lib 文件夹中。在 Eclipse 中重新启动我的 tomcat 服务器后,我得到一个
SEVERE: Error filterStart
和
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor.
所以我添加了一个asm-all-4.1.jar
,我得到了同样的错误,但这次是:
java.lang.NoClassDefFoundError: org/objectweb/asm/commons/EmptyVisitor.
我查看了插件的文档页面,但它甚至没有提到这个 asm 依赖项。我也尝试在 tomcat 的类路径中包含罐子,但这也没有用。帮助!
java - Struts 2 错误 - com.opensymphony.xwork2.util.logging.commons.CommonsLogger 错误
我正在尝试运行 Struts2 示例应用程序。在启动服务器时,我遇到了错误和从这里使用的代码。我在这里实现了相同的代码相同的罐子。
struts2-convention-plugin-2.3.1.2.jar、asm.jar、
antlr-2.7.6.jar、commons-fileupload-1.2.2.jar、
commons-io-2.0.1.jar、commons-lang-2.5。 jar、
commons-logging-1.1.1.jar、commons-logging-api-1.1.jar、
freemarker-2.3.18.jar javassist-3.11.0.GA.jar、ognl-3.0.4.jar、struts2-core -2.3.1.2.jar,xwork-core.2.3.1.2.jar
java - Struts 2 插件转换 - 从 Codebehind 到 Convention 插件
我对将代码隐藏注释转换为常规struts.xml
文件感到困惑。
如何识别动作类中的动作名称?因为如果 write method public String list{}
- action 它与 JSP 的匹配product-list.jsp
将自动识别页面和 URL 就是product!list
这样。什么是常规插件?
当前网址:
http://localhost:7001/example/product!search
- jsp 名称product-search.jsp
和ProductAction
- 动作类。
请告诉我如何配置与struts.xml
上述配置等效的文件。
我试过如下:
错误 :
java - 如果我更改 struts.xml 路径,struts2-convention 和 struts2-config-browser-plugin 将无法工作
我在 struts2 中使用 struts2-convention-plugin 和 struts2-config-browser-plugin,如果我更改 web.xml 中的默认 struts.xml 路径:
他们不能再工作了,为什么?
java - Upgrading to Struts 2.3.15 - Convention Plugin cause crash on startup
I'm in the process of upgrading my Struts2 installation to 2.3.15. After adding the struts2-convention-plugin-2.3.15.jar
my web-app fails to start. The relevant part of the exception listing is;
Anyone got any idea what's going on?
EDIT:
The full trace is;
rest - struts2-rest plugin..making both struts actions + rest actions work together but. giving java.lang.reflect.InvocationTargetException
I am converting my existing struts 2 application to serve through some rest based services also.
I have used two plugins, struts2-rest plugin and struts-convention plugin,
Along with these I have also used asm.jar because above was giving a class not found exception which was there in asm jar.
I want to have both the functionalities as ..my normal struts action mappings should also work along with rest urls.
struts.xml
web.xml
I m not able to find any error..
what i see on screen when i run either struts action based mapping or rest url ..is :
spring - 在带有 Spring 和 Convention 插件的 Struts2 中使用带注解的拦截器
我一直在尝试在 struts2 中使用带有注释的拦截器来处理我的请求和响应,以便我可以执行一些前置和后置操作。
但是,我最初使用带有约定插件的 struts 2,我无法真正改变。我的框架中还包含了 spring。
但是,现在的问题是,每当我尝试使用拦截器作为注释时,它都会在应用程序开始时给我以下异常。
我的代码结构很简单:
动作类看起来像:
Struts.xml:
我的部署描述符主体(web.xml):
现在希望它有助于弄清楚为什么它会抛出该异常,因为我认为我不需要从我的操作中删除ModelDriven的实现。
提前致谢
struts2 - 没有为与上下文路径 [APP_NAME] 关联的命名空间 [/] 和操作名称 [abc] 映射的操作
在我的 Struts2 代码中使用注释时,我遇到了这个问题。
我的 Annotated Action 类看起来像这样,它使用拦截器,我的架构基于 Spring 3、Struts 2,并使用 Struts2 Convention Plugin
我还试图附上我的部署描述符的详细信息
我已经定义了我的拦截器struts.xml
,我只是用它来定义拦截器和结果类型
我也尝试过devMode
true 或 false 但没有帮助。
我的目录结构是
编辑:
在了解更多细节并添加详细日志之后,我的日志中又多了一件事情。
这只是我在这里提到的一个例外,而它对我的应用程序中可用的每个操作类都给出了相同的例外。
java - xwork 和 xwork-core 中的冲突
我一直在尝试将 Struts 2 与零配置、Spring、Hibernate 和 Maven 集成。
但是,我认为在集成中一定有一些我缺少的东西,它必须与 Maven 的配置有关Pom.xml
:
当我使用此配置时,它给了我一个错误
而不是 opensymphony XWork libaray 我使用依赖
它向我抛出了这个异常