spring

How to "white label" spring beans

We have a white labeled application (one application supporting a branded experience for multiple customers). We would like to be able to load a co-brand version of a component to support custom components per customer. For example something like: <!-- default service --> <bean id="service" class="com.blah.myService" primary="true"> ...

downloaded STS, how to import/open petcare?

The spring website says: The petcare sample application referenced in this presentation can also be accessed in the Spring Samples SVN repository. This sample app is directly importable & runnable with SpringSource Tool Suite I downloaded the spring tool suite, can't find any import mechanism? ...

Strategies for designing a database (being accessed by hibernate) which will have alot of archivial data.

I am developing an application which will be integrated with thousands of sensors sending information at every 15 minute interval. Let's assume that the format of the data for all sensors is same. What is the best strategy of storing this data so that every thing is archived (is accessible) and does not have a negative impact due to larg...

Spring 3 + Hibernate WebApp tutorial

Are there any good tutorials how to start weppapp with Spring 3, eclipse and hibernate? ...

JPA Detected reentrant flush

I have little problem with openjpa implementation of jpa with spring 2.5. My dao method: @Transactional public User getUserByName(final String name) { return (User) getEntityManager().createQuery("select u from User as u where u.name = :name").setParameter("name", name).getSingleResult(); } returns org.springframework.dao.InvalidD...

Lazy initialization of cache with Spring IBatis

We are moving our legacy implementation to Spring IBatis model. I am kind of stuck in modeling these objects in cleaner way using Spring model Lets say I have two classes [ Both of them are singleton ] DAOImpl implements DAOInterface CacheDAOImpl implements DAOInterface Code snippet showing object initialization in CacheDAOImpl ....

Change Spring email settings based on dev/test/prod mode

I often test my application with a copy of a live database, but have to be careful to not do any actions that cause an email to be sent to a user. I'd love to have a way to configure spring so that when I'm in dev or test mode, that no email will get sent to real users. Ideally, I'd like for all of the emails that should have gone to the...

Creating beans on-demand using spring

Hi all, I want to create some spring beans after startup in a factory-ish pattern. For example every so often I have some work to do and I need to create a task bean (which probably has dependents on other singleton spring beans) and execute it. There may be several pieces of work to execute concurrently so each task bean needs to be ...

Where is the debug class path in netbeans / where does the spring config XML file go?

I have a java desktop app (main project) and another project with a series of packages in NetBeans. Some of the packages use spring for JDBC and IOC. I am getting the following error when running in debug: Caused by: java.io.FileNotFoundException: class path resource [config.xml] cannot be opened because it does not exist Where is th...

Trying out Spring 3 MVC, Getting a page error

Trying to configure spring 3 MVC, here is what I did so far: I added all the spring 3.0 libraries to my netbeans project. My web.xml is: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_...

Setting content type in an action

In spring mvc 3.0, how can I set the content type of a particular action? I want to set the action to return a json result. ...

Using Spring, mapping to root in web.xml, static resources aren't found

I'm not quite a newcomer to Spring but what I'm attempting now I've never done. Iteemed basic when I started but I've run into a problem. What I'm trying to do is map requests to the servlet root (correct terminology?). I'm at the point where URLs are mapped to correct view but all the static content - css, javascript, images - that is...

Spring SimpleFormController onSubmit request parameters

I am using SimpleFormController in my application to handle form submisions. one thing i am missing is the request object that is passed onSubmit(request,response..) is a different one from the initial request object that is received by formBackingObject(..).probably because it is again a new request from web. i just want to use the sa...

Use Spring annotations to automatically apply Hibernate Interceptor?

In my service class I need the hibernate session available. I currently do this in the beans.xml: <bean id = "userDao" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="target"> <ref bean="userDaoTarget" /> </property> <property name="proxyInterfaces"> <value>com.app.dao.UserDao</value> </property> ...

Using Spring and Hibernate -final year project

I’m planning to build Management Information System in Java for my final year project. I would like to use Spring and Hibernate, however I haven’t used any of these frameworks yet. Hence my question is, will I have enough time to learn it (I don’t mean to be an expert, just to be able to use them in my project) and still complete my pro...

Spring MVC Application - How do I set a session scoped bean value

In my application I need to gather information on one screen and then display it on the next. I have selected to store this information in a bean with a scope set as session ( it will be used in several other screens after the initial data gathering screen) Manger configured as follows: <bean name="/springapp.htm" class="foo.bar.cont...

When releasing a java spring web application, what are the steps to deploy/release?

If I make a spring mvc application, what are the things I have to do to deploy the application? (say its a commercial application) What options do I have? Do all applications compress the classes into a .war file? /WEB-INF/web.xml, appname-servlet.xml, etc. /WEB-INF/jsp/*.* /WEB-INF/appname.war ??? ...

How do you create a Spring MVC project in Eclipse?

I am trying to follow basic tutorial for Spring MVC but get lost at creating a new project in Eclipse. It seems that most tutorials assume you know how to create a Spring Project in Eclipse. Any advice on where to get started or tutorials which explain how to set up Eclipse would be appreciated. ...

Android and Dependency Injection

I've been looking around, in vain, for some information on using a dependency injection container in Android development. Specifically, how to override the creation of an Activity in a way that will also work when coming back from being killed (for whatever reason). Has anyone got any experience in this area? ...

Spring compared to JSF 2

Hello, I haven't used Spring, but it sounds like it is fairly popular. I heard that it provides alternate ways of doing things, such as being able to consume RESTful web services. Does anyone know if provides similar features as those introduced by JSF 2, or would I be comparing apples to oranges? Edit: Thanks for the information. ...