In the examples from Jeremy on this config setup I see this: web-application-config.xml file. Is this file taking the place of the applicationContext.xml? I'm not really sure what the purpose of this file is; as there is no real explanation on it in the docs. I have setup my Spring app. to use iBatis and I'm trying to use the BlazeDS integration to talk to my serviceImpl.I unfortunately have a gap in my understanding of how this is wired together from the perspective of the applicationContext.xml and the web.xml with this file mentioned above(web-application-config.xml). In your article here: http://blog.springsource.com/2008/12...ntegration-m1/ some of your files are unclear as to what configuration block is going where.
Anyway I'm using JDK1.5, Spring2.5.5,BlazeDS3.2 -
Here is my applicationContext.xml
and of course the web.application-config.xml as mentioned in your post as well as the remoting-config.xml, services-config.xml and remoting-config.xml.Code:<!-- - Nestle primary business object (default implementation). - Transaction advice gets applied through the AOP configuration below. --> <bean id="nestleDataService" class="com.talisen.domain.logic.NestleDataServiceImpl"> <property name="accountDao" ref="accountDao"/> <property name="buildingDao" ref="buildingDao"/> <property name="electricDao" ref="electricDao"/> </bean> <!-- Expose the nestleDataService bean foro BlazeDS remoting --> <bean id="nestleService" class="org.springframework.flex.messaging.remoting.FlexRemotingServiceExporter"> <property name="messageBroker" ref="mySpringManagedMessageBroker"/> <property name="service" ref="nestleDataService"/> </bean> <!-- Maps request paths at /messagebroker to the BlazeDS MessageBroker --> <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <value> /messagebroker/*=mySpringManagedMessageBroker </value> </property> </bean> <!-- Dispatches requests mapped to a MessageBroker --> <bean class="org.springframework.flex.messaging.servlet.MessageBrokerHandlerAdapter"/>
Here is the web.xml-
Anyway some explanation of what or how the web-application-config.xml gets called from all this or the app. knows about it would help or can I just move that logic out and put it in the applicationContext.xml?Code:<?xml version="1.0" encoding="ISO-8859-1"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>Nestle Data Service</display-name> <description>Nestle Data Application</description> <!-- - Key of the system property that should specify the root directory of this - web app. Applied by WebAppRootListener or Log4jConfigListener. --> <context-param> <param-name>webAppRootKey</param-name> <param-value>nestle.root</param-value> </context-param> <!-- - Location of the Log4J config file, for initialization and refresh checks. - Applied by Log4jConfigListener. --> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.properties</param-value> </context-param> <!-- - Location of the XML file that defines the root application context. - Applied by ContextLoaderServlet. - - Can include "/WEB-INF/dataAccessContext-local.xml" for a single-database - context, or "/WEB-INF/dataAccessContext-jta.xml" for a two-database context. --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/dataAccessContext-local.xml /WEB-INF/applicationContext.xml</param-value> </context-param> <!-- - Configures Log4J for this web app. - As this context specifies a context-param "log4jConfigLocation", its file path - is used to load the Log4J configuration, including periodic refresh checks. - - Would fall back to default Log4J initialization (non-refreshing) if no special - context-params are given. - - Exports a "web app root key", i.e. a system property that specifies the root - directory of this web app, for usage in log file paths. - This web app specifies "petclinic.root" (see log4j.properties file). --> <!-- Leave the listener commented-out if using JBoss --> <listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <!-- - Loads the root application context of this web app at startup, - by default from "/WEB-INF/applicationContext.xml". - Note that you need to fall back to Spring's ContextLoaderServlet for - J2EE servers that do not follow the Servlet 2.4 initialization order. - - Use WebApplicationContextUtils.getWebApplicationContext(servletContext) - to access it anywhere in the web application, outside of the framework. - - The root context is the parent of all servlet-specific contexts. - This means that its beans are automatically available in these child contexts, - both for getBean(name) calls and (external) bean references. --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- - Spring web MVC servlet that dispatches requests to registered handlers. - Has its own application context, by default defined in "{servlet-name}-servlet.xml", - i.e. "petstore-servlet.xml" in this case. - - A web app can contain any number of such servlets. - Note that this web app has a shared root application context, serving as parent - of all DispatcherServlet contexts. --> <servlet> <servlet-name>nestleDataFetcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/config/web-application-config.xml</param-value> </init-param> <load-on-startup>11</load-on-startup> </servlet> <!-- - Dispatcher servlet mapping for the main web user interface. - Either refering to "petstore" for the Spring web MVC dispatcher, - or to "action" for the Struts dispatcher. - - Simply comment out the "petstore" reference in favour of "action" - to switch from the Spring web tier to the Struts web tier. --> <servlet-mapping> <servlet-name>nestleDataFetcher</servlet-name> <url-pattern>/spring/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page> </web-app>
Thanks!


Reply With Quote
