struts2-convention-plugin

Startup Error: java.lang.IncompatibleClassChangeError: org/apache/struts2/convention/DefaultClassFinder$InfoBuildingVisitor

限于喜欢 提交于 2020-01-03 03:40:07
问题 I have a Struts2 application, originally XML-based, but now for the first time I introduced an Annotation-based action, and the application broke on startup. Given the following Action mapping, on startup of the application, I get the error java.lang.InstantiationError: com.opensymphony.xwork2.util.finder.ClassFinder at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390) at org.apache.struts2.convention

struts.convention.result.path is not working in Struts2

馋奶兔 提交于 2020-01-03 03:10:12
问题 My current project structure is as follows WebContent WEB-INF View TestPage.jsp other JSP pages... My assignment is to put all JSP pages inside folder WEB-INF and do all relative changes in the project. WebContent WEB-INF View TestPage.jsp other JSP pages... So I have to update all result tag in struts.xml <result name="success">/View/TestPage.jsp</result> to <result name="success">/WEB_INF/View/TestPage.jsp</result> After search on web I found a plugin - struts convention plugin to achieve

Using convention plugin with struts.xml

∥☆過路亽.° 提交于 2019-12-23 05:08:54
问题 I'm using convention plugin in my project and everything was fine until I needed to add a custom Interceptor. To add a custom Interceptor I need to have struts.xml in my project. But when I add struts.xml, it gives me 404 error for every page. I have tried this solution but it doesn't seem to work. Thanks. 回答1: The struts.xml configuration file should be in the source folder, such as src or resources . When you build the application the compiled output directed to WEB-INF/classes . You can

struts2-rest plugin..making both struts actions + rest actions work together but. giving java.lang.reflect.InvocationTargetException

混江龙づ霸主 提交于 2019-12-22 10:27:44
问题 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 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache

Global results with Struts 2 and convention plugin

*爱你&永不变心* 提交于 2019-12-11 01:14:40
问题 i would like to have some global results in my application. In good old XML configuration it would look like: <global-results> <result name="error" type="redirectAction"> <param name="actionName">index</param> <param name="namespace">/</param> </result> </global-results> But as I'm using the convention plugin the global results in the XML seem to be ignored so how could I implement this using the convention plugin? I don't want to have all my action classes extend a custom class that has

Why the Exception raised from my Interceptor is not caught by <global-exception-mappings>?

跟風遠走 提交于 2019-12-10 11:07:49
问题 I have a custom Interceptor, from which I throw an Exception; The Action(s) running that Interceptor is managed by Convention plugin; The Exception raised by the Interceptor is globally defined in struts.xml for the package the Action is running into. RESULT: the exception mapping is ignored and I get the Struts Problem Report Struts has detected an unhandled exception: ... Stacktraces java.lang.IllegalArgumentException: my message I guess I'm just missing something stupid... we've already

Conflicts in xwork and xwork-core

蓝咒 提交于 2019-12-08 13:08:30
I have been trying to integrate Struts 2 with Zero Configuration, Spring, Hibernate and Maven. But, what I think there must be something which I am missing in integration and it must be related to the configuration of Maven's Pom.xml : <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.1.8.1</version> </dependency> <!-- Struts 2 + Spring plugins --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.1.8.1</version> </dependency> <!-- MySQL database driver --> <dependency> <groupId>mysql<

Conflicts in xwork and xwork-core

一世执手 提交于 2019-12-08 07:44:29
问题 I have been trying to integrate Struts 2 with Zero Configuration, Spring, Hibernate and Maven. But, what I think there must be something which I am missing in integration and it must be related to the configuration of Maven's Pom.xml : <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.1.8.1</version> </dependency> <!-- Struts 2 + Spring plugins --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId>

How set base package to scan subpackages for actions?

廉价感情. 提交于 2019-12-07 16:00:46
问题 How can I tell to Struts 2 convention plugin to scan all subpackages of a package. I tried with this <constant name="struts.convention.action.suffix" value="Controller" /> <constant name="struts.convention.package.locators.basePackage" value="fi.fpf.mvc" /> and this <constant name="struts.convention.action.suffix" value="Controller" /> <constant name="struts.convention.package.locators.basePackage" value="fi.fpf.mvc.*" /> but they don't work. my actions end with "Controller" suffix. Someone

How to use Struts2 convention without using any action class

故事扮演 提交于 2019-12-07 15:24:23
问题 In Struts2 we can define action without using action class in struts.xml as follows: <action name="error"> <result>/error.jsp</result> </action> In my application I am using struts2 convention . In this case how to avoid writing action classes. I have many scenarios where I just want to go to the page without using any business logic. My result path is not just a JSP. I am using tiles. I am using code as follows: @Action(value="homePage", results={@Result(name="success", location="homePage",