application-context

Getting Spring Application Context

Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass that down throw the call stack to any classes that need it, or is there a way for a class to ask for the previously created context? (Whi...

Glassfish: web application deployed with non-root context interperetes requests relative to domain1/docroot

The webapp uses Spring MVC. <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="urlMap"> <map> <entry key="/*" value-ref="defaultHandler"/> </map> </property> <property name="order" value="2"/> </bean> <bean name="defaultHandler" c...

Spring.Net IoC Application Context Problem

Hi, I'm having the following "problem". I created a application context file for spring.net. The configuration looks like this: <spring> <context> <resource uri="config://spring/objects"/> </context> <objects configSource="SpringObjects.config" /> </spring> I was told that if you change something to the application context you...

Splitting applicationContext to multiple files

What is the correct way to split Spring's configuration to multiple xml files? At the moment I have /WEB-INF/foo-servlet.xml /WEB-INF/foo-service.xml /WEB-INF/foo-persistence.xml My web.xml has the following: <servlet> <description>Spring MVC Dispatcher Servlet</description> <servlet-name>intrafest</servlet-name> <servlet-class> ...

"Recycling" names within a spring application context

lets say, I have a lot of stuff within my spring application context which looks like that <bean name="foo.0001" class="com.example.MyClass"> <property name="name" value="foo.name.0001"/> <property name="zap"> <bean class="com.example.Other"> <property name="name" value="foo.name.0001"/> </bean> <...

Passing properties to a Spring context

I'm using Spring to handle RMI calls to some remote server. It is straightforward to construct an application context and obtain the bean for remote invocations from within the client: ApplicationContext context = new ApplicationContext("classpath:context.xml"); MyService myService = (MyService ) context.getBean( "myService " ); Howe...

How do you load a bean into Spring MVC's application context?

As I understand it, Spring MVC application has two distinct contexts, the application context and the web context, which are controlled by applicationContext.xml and dispatcher-servlet.xml, respectively. Inside my controllers, how do I go about loading a bean into either of these contexts? Note that I am aware of Getting Spring Applica...

Spring ApplicationContext Bean Scope

When you create a Service bean or Dao bean in your Spring applicationContext.xml file, what is the scope of those beans? Will every person who accesses the web application use the same instance of the bean, or is the bean instantiated for each user's session? ...

Grails Application context

Hi! I have a grails / groovy application running under tomcat. For some reason I have to be able to change the application context dynamically. That is, I want to be able (at login time) to set this context. I know that this is doable via the Config.groovy but this is static. At login time I am getting a parameter which is the context...

Spring applicationcontext loading hooks

Are there any hooks into the Spring ApplicationContext loading process? I want to run a piece of code just before the application context loads (before any beans/properties/aspects/etc... are instantiated). thanks in advance ...

Spring Application Context Switch at Runtime

Hi, I'm wondering if it is possible to change which application context your app is using at run time. The use case would be: I have a GUI that allows you create queuing networks. It also allows you to select which simulation library you would like to use run the model you've just created. Each library has its own application contex...

NoSuchMethodError with Spring MutableValues

Hello experts! I have written a test where i specify my application context location with annotations. I then autowire my dao into the test. @ContextConfiguration(locations = {"file:service/src/main/webapp/WEB-INF/applicationContext.xml"}) public class MyTest extends AbstractTestNGSpringContextTests { @Autowired ...

ApplicationContext ctx = new FileSystemXmlApplicationContext error

Hi I am completely new to Java, so sorry if my question may sound a bit stupid. I am following a tutorial on hibernate and i am trying to get the context definition files from the file system. ApplicationContext ctx = new FileSystemXmlApplicationContext( new String[] { "conf/rssWebApplication-services.xml", "conf/rssWe...

Good way to access Spring singleton from within domain objects?

I have a domain model that consists of fairly large object graphs, where domain objects are creating other domain objects and so forth. Each of these domain objects needs access to a small handful of singleton-type helper objects for various purposes. I was about to implement them using the Java singleton pattern when I remembered t...

Spring configs for webapps -> location in WEB-INF mandatory?

Hi all I have just finished building my up from bottom (database) over DAO and business layer. Now I am getting warm with the presentation layer for which I chose Spring MVC. I have checked out the example delivered with spring-webflow-samples/booking-mvc. I was wondering why all spring configs are located in webapp/WEB-INF/config rat...

Loading spring context in web application after some servlet

Hi all, We need to load the spring application context in our web application after one of our servlets is initialized, so I wonder what is the best way to do it? I know that it's recommended to use the listener in web.xml, but it's obviously not good for us because in this case the context will be loaded before the first servlet. I s...

Hibernate is not updating record - Wicket

Hi. I'm working on a web application with Wicket, Spring and Hibernate and I've come across a problem with updating records. I have verified that the saveOrUpdate method is invoked, and that the data in the domain object has changed. The SQL-output does however not display that any changes to the database has been made (UPDATE in exampl...

Application Controller and Application.Run() - Stop Program When UI Ends

I have an application controller with navigation workflow like so: namespace Ordering.UI.Workflow { public static class ApplicationController { private static INavigationWorkflow instance; private static string navigationArgument; public static void Register(INavigationWorkflow service) { ...