Struts + Spring Integration issue with struts-config.xml

I am trying to integrate Struts with Spring. Struts alone is working fine. However when I am trying to put

<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation"
            value="/WEB-INF/lib/WebApplicationSpringContext.xml" />
    </plug-in>
    <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />

element in side struts-config.xml, The xml start throwing

The content of element type "struts-config" must match "(data-sources?,form-beans?,global-exceptions?,global-
 forwards?,action-mappings?,controller?,message-resources*,plug-in*)".

Following is my struts-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>


    <form-beans>
        <form-bean name="userForm"
            type="com.sample.form.UserForm" />
    </form-beans>

    <action-mappings>

    <action path="/user" type="com.sample.action.UserAction"
            name="userForm" scope="request" validate="true">
            <forward name="success" path="/WEB-INF/jsp/welcome.jsp" />
            <forward name="failed" path="/WEB-INF/jsp/user.jsp" />
        </action>

    </action-mappings>

<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation"
            value="/WEB-INF/lib/WebApplicationSpringContext.xml" />
    </plug-in>

    <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />

</struts-config>

Following is WebApplicationSpringContext.xml

<?xml version="1.0" encoding="UTF-8" ?>

<beans:beans xmlns="http://www.springframework.org/schema/security"
    xmlns:beans="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/jdbc
        http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd      
        http://www.springframework.org/schema/security
        http://www.springframework.org/schema/security/spring-security-3.0.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

    <beans:bean name="/user" id="user"
        class="com.sample.action.UserAction">
        <beans:constructor-arg index="0" value="sample" />
    </beans:bean>

</beans:beans>

I am stuck with struts-config.xml. Thanks in advanced. Any suggestions will be welcome.

Answers


The content of element type "struts-config" must match "(data-sources?,form-beans?,global-exceptions?,global- forwards?,action-mappings?,controller?,message-resources*,plug-in*)".

Try putting:

<controller processorClass=...

above:

<plug-in className="

meaning switch the tags order


Need Your Help

How to submit a form when validation fails

extjs extjs4

I need to submit a form which contains some fields that may be invalid. For example, there may be some fields that have attribute allowBlank set to false. I tried to do this before submitting:

Update data from server periodically design

android multithreading timer

I had a problem about how to design updater for my program. Which the best order to update data from the server? (absolutely multithreading)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.