xml-configuration

define interceptors with struts2 annotations

梦想的初衷 提交于 2019-12-05 21:57:19
I'm trying to use the struts2-convention-plugin which provides java annotations to define struts2 components. With Actions so far so good but how can i use annotations to define interceptors ? (i'm talking of @InterceptorRefs or @InterceptorRef ). Is this even possible ? At the moment i've configured actions with annotations and interceptors with the struts.xml file. Is it possible to completely eliminate the struts.xml file and use a 100% annotation oriented configuration ? The struts2-convention-plugin doesn't replace XWork and its configuration which is xml based. So you cannot eliminate a

java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getResourceLoader()Lorg/springframework/core/io/ResourceLoader

扶醉桌前 提交于 2019-12-04 19:48:54
问题 I am working on a Spring application on Tomcat7, JDK1.7, Maven and other components. Recently, I made a major change to the application, requiring switching over to Spring 3. After the change, I'm seeing the below exception on deploying to dev server. The application runs flawlessly on my local system though. javax.servlet.ServletException: Servlet.init() for servlet amadeusAce threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache

Elasticsearch HTTP authentication in Spring

不羁的心 提交于 2019-12-04 10:14:30
I want to access a remote elasticsearch which is protected by a username and password. https://[username]:[password]@aws-eu-west-1-portal1.dblayer.com:11109/ In Spring using the XML config I was able to access my localhost elastic as shown below <!-- ElasticSearch --> <elasticsearch:repositories base-package="be.smartsearch.service.repository.elasticsearch" /> <elasticsearch:transport-client id="esClient" cluster-nodes="localhost:9300" /> <bean id="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate"> <constructor-arg name="client" ref="esClient" />

What's causing this NPE when I request an action?

不羁岁月 提交于 2019-12-04 06:29:33
This error was not there when I first run my program,then I tried some experiment to get the flow of MVC architecture but now it is showing me this exception. I guess the problem is when I request via subscribe button it will go to struts.xml where it will look for action. The problem is in package tag what should be there 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)

How-to configure Spring Social via XML

让人想犯罪 __ 提交于 2019-12-03 09:47:51
问题 I spend a few hours trying to get Twitter integration to work with Spring Social using the XML configuration approach. All the examples I could find on the web (and on stackoverflow) always use the @Config approach as shown in the samples For whatever reason the bean definition to get an instance to the twitter API throws an AOP exception: Caused by: java.lang.IllegalStateException: Cannot create scoped proxy for bean 'scopedTarget.twitter': Target type could not be determined at the time of

How to wtite pretty URL in Struts2.x?

◇◆丶佛笑我妖孽 提交于 2019-12-01 14:01:25
I want to rewrite my URL in Struts2. Please help me out to do this. How can i customize as i want, i don't want to show my parameter that i am passing and also show action with different name that i want I don't know how to do it. i have to use plugins for that or configure my code in struts.xml <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.action.extension" value="action" /> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts

Regarding the Action Mapping in Struts2 - There is no Action mapped

烈酒焚心 提交于 2019-12-01 12:32:39
问题 I am trying to run my struts application but I am getting a error action is not mapped I have seen the namespace it is correct but still getting the error? 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> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="false" /> <include file=

Struts2 URL unreachable

点点圈 提交于 2019-12-01 07:51:41
问题 I'm really racking my head here with Struts2 - I'm able to access the JSP pages by omitting part of the path. Note the path suppose to include pages/welcome_user.jsp . The key is to look at the word pages in the path. here's the struts.xml file: <?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> <package name="default" namespace="/User" extends="struts

many-to-many mapping in NHibernate

本小妞迷上赌 提交于 2019-11-29 03:14:23
问题 I'm looking to create a many to many relationship using NHibernate. I'm not sure how to map these in the XML files. I have not created the classes yet, but they will just be basic POCOs. Tables Person personId name Competency competencyId title Person_x_Competency personId competencyId Would I essentially create a List in each POCO for the other class? Then map those somehow using the NHibernate configuration files? 回答1: You can put the many-to-many relation to either class, or even to both.

Unable to load bean: type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer

本小妞迷上赌 提交于 2019-11-28 13:11:32
I am running the Struts2 application in eclipse but it is displaying the error while running in the Apache Tomcat server the error I am getting is SEVERE: Dispatcher initialization failed Unable to load configuration. - bean - jar:file:/C:/projectdetails/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/FieldError/WEB-INF/lib/struts2-gxp-plugin-2.3.16.3.jar!/struts-plugin.xml:8:162 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445) at org