spring

How to create Swing OSGi bundles on AWT EventQueue with Spring DM

I have an OSGi target platform consisting of Equinox, the Spring Framework, Spring DM, and several custom bundles for my application. All of my bundles contain Spring application contexts and so are automatically loaded by the Spring OSGi extender. Some of my bundles contain Swing ui components. The problem is that the Spring OSGi Exten...

Accesing spring context from jaas LoginModule

Hi all, I've implemented a Jaas Login Module, in order to perform authentication. I must access database to retrieve user/pass information within this module. In the same project, there exists some DAO bean's implemented, but it's impossible to access Spring context from the jaas login module, to retrieve the DAO bean. ¿Anyone could h...

Testing with Spring - Avoiding false positives?

In the spring documentation regarding testing, it states: Avoid false positives when testing ORM code When you test code involving an ORM framework such as JPA or Hibernate, flush the underlying session within test methods which update the state of the session. Failing to flush the ORM framework's underlying sessi...

Scheduling tasks to run once, using the Spring task namespace

I'm setting up a scheduled tasks scheme in spring, using the task namespace. I want to schedule most tasks to fire according to a cron expression, and some to fire just once, a fixed delay after startup, and then never again (i.e. what setting repeatCount to 0 on a SimpleTriggerBean would achieve). Is it possible to achieve this withi...

Inject an external property into Spring context

I have three apps in a Spring 2.5 managed project that share some code and differ in details. Each application has a property (java.lang.String) which is used before the application context is built. Building the app context takes some time and cannot happen first. As such, it's defined in each individual application. This property i...

Using MultiActionController

Currently i am using paging on my page which uses MultiActionController which displays a jsp page perfectly , on the same page now i want to validate a simple textfield (input/form:input) also want to retrieve name and id from a dropdown(Select option) once a link is clicked. Simple !! Two questions Can i use a class implements Vali...

AbstrcatWizardFormController: teasing postProcessPage(..)

Hi I've been having a problem for a while that I am not able to understand. The situation is like this.. I have a page in the wizard that I use for adding business locations (BusinessLocation.java entity) of a service provider (ServiceProvider.java entity) but the thing is that I dont get a consistent result when I see the next page in ...

going crazy about the spring mvc checkbox

I got the checkbox working, but I can't remember what modification I have done to my code. it's never working again. it keeps saying: org.springframework.web.servlet.tags.form.Checkbox Tag - java.lang.NullPointerException at org.springframework.web.servlet.tags.form.Selected ValueComparator.exhaustiveCompare(SelectedValueCom parator.ja...

Spring 3 MVC - Advanced Data Binding - Form Request with List of Simple Objects

I've read through all of the Spring 3 Web docs: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/spring-web.html but have been completely unable to find any interesting documentation on binding more complicated request data, for example, let's say I use jQuery to post to a controller like so: $.ajax({ ...

Equivalent of Spring's "parent" in Castle Windsor

In Spring Framework (both for java and .net) i can use the following definition of objects: <object id="parentObject" type="Type1" abstract="true"> <property name="name" value="parent"/> <property name="age" value="1"/> </object> <object id="childObject" type="Type2" parent="parentObject"> <property name="name" value="override"/>...

How best to unit test Spring's SimpleMappingExceptionResolver

I have extended org.springframework.web.servlet.handler.SimpleMappingExceptionResolver to log and return custom error messages to my Spring MVC application. My question is - how should I go about writing a JUnit test to check that the correct errors get returned when the associated Exceptions get thrown? ...

How can I limit memory usage when generating a CSV from a large resultset?

I have a web application in Spring that has a functional requirement for generating a CSV/Excel spreadsheet from a result set coming from a large Oracle database. The expected rows are in the 300,000 - 1,000,000 range. Time to process is not as large of an issue as keeping the application stable -- and right now, very large result sets c...

How can I map a different parent class in different projects to the same shared child class?

Summary: I have two projects using the same database relation. I would like to map the relation differently in each project, using the same child class but different parent classes. Detail: I have two projects, ADMIN and SERVICE. ADMIN allows the persisted object Promo to be configured. SERVICE will read Promo. We're using Spring...

Filtering out log4j messages from third-party frameworks?

How do I filter log messages from external third party frameworks? I am using Hibernate and Spring framework and I would like to suppress the logs so that only my log4j logs appears. ...

Invoke proxy AOP by calling method within the bean

lets say the I have got a bean called with two methods 'foo' and 'goo' and 'goo' is marked with AOP interception call. is it possible to write any piece of code inside 'foo' in order to invoke 'goo' method not directly but through the proxy wrapper of the bean in order to activate the AOP part of it? public Class Pojo{ public void f...

Should I create multiple services (using the Spring `@Service` stereotype) to do database lookups for different controllers?

I'm not sure where to do database lookups for Spring controllers. It seems to make sense to use the Spring @Service stereotype and create multiple "services" to provide lookup support to controllers rather than doing lookups directly in the controllers. Is this correct or is there a more appropriate place to perform database lookups? ...

Apache Axis2 and Spring3 how to use @Autowired

I haven't used Apache Axis since my 1.x days so I am little rusty here. My question is this.... How do I go about using the @Autowired annotation in my Apache Axis2 service endpoint class? Is this possible? I did some google searching and have yet to find anything conclusive. I am using Apache Axis2 version 1.5.1 and Spring 3.0.3. I just...

After calling URL "/article/1234abcd" how to retrieve the value `1234abcd` from inside the `article` action?

@RequestMapping(value = "/article", method = RequestMethod.GET) public final String article(final ModelMap model) { } If this is called using the address: /article/1234abcd How can the value 1234abcd be retrieved from inside the article method? ...

Test-resources of dependecies not in classpath?

I have a multi module Spring project that I set up using Maven: my-root (pom) - my-logic - my-webapp (depending on my-logic) - my-consoleapp (depending on my-logic) My Test classes inherit from AbstractTransactionalJUnit4SpringContextTests and use @ContextCofiguration for setting up the ApplicationContext. E.g. the test c...

Spring RMI non-JRMP server at remote endpoint

I'm running the following code: import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; public class RmiClient { public static void main(String args[]) { try { String hostName = "hostnameChangedForOnlineReference"; Registry registry = LocateRegistry.getRegistry(hostName, 1099); ...