spring

Spring - multiple command class with AbstractWizardFormController

Can i have a AbstractWizardFormController controller with different command class for each page ? ...

back button filter not working

Hello I have configured a filter to disable my browser back button and show the user as session expired. It is working as expected when i configure that in my application prototype but when i incorporated it to my (spring MVC) application it is not working. I have configured my filter like this <filter> <filter-name>backButtonFilter<...

Spring MVC and JSF navigation rules together

I am trying to develop a sample application using both Spring Framework and JSF. Q #1. The big doubt I have is whether I should use Spring Controllers and view resolvers to perform page navigations? OR whether I have to use standard JSF navigation rules (in faces-config.xml) to handle page navigation? How can I evaluate which one is bet...

How to store mail password on server side?

I need to send e-mails from my application that is deployed on Weblogic 10.0. I try to put mail session properties on server side. Properties like mail.host or mail.debug work OK. But how do I configure password? Now I have it in spring configuration file: <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSender...

How to connect HttpServlet with Spring Application Context in web.xml?

I'm trying to connect my FooServlet which extends HttpServlet with the ApplicationContext which is in the same Project. The Application Context is already used by a Wicket Servlet It works with servletContext = this.getServletContext(); wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); (IMyBean)wac().g...

Spring MVC: Resolving the view based on User-Agent

Spring Version: 2.5.6 I want to resolve the view to a specific velocity file based on the value of the User-Agent header. My current line of thinking is an implementation similar to the UrlBasedViewResolver such that the user-agent value is Map'd (via context) to a specific directory(value) based on a matching a regular expression(key)...

Maven profiles basic datasource, jee:jndi-lookup

I have a project with spring and maven. I found that using profiles, maven could change the properties of the data source. But what if in production the datasource is with a lookup like this, how to do the profiles for this: one with a basic datasource and the other a jee lookup. <jee:jndi-lookup id="dataSourcejndi" jndi-name="jdbc/BGG...

Idiom for achievieng imperative wiring in a declarative Spring xml config?

I am a user of class A, which is provided to me as a library. In my spring config I specify an A bean, which Spring happily instantiates for me. As a side effect, A creates its own instance of B, which it exposes via A.getB(). B exposes a setC() method that I wish to invoke with a C that I configure in spring. How do I do this? I'...

Hibernate session problem for transactions.

Hi all, I am new to hibernate and trying integrate hibernate with an existing spring based application. I configured session factory and transaction manager, transaction proxy template. I am also using Quartz scheduler in this application. When I run the application, I am getting the following exception. ERROR au.com.michaelpage.cts...

GWT using domain models /services from external module (jar) ?

Greetings, We have been using our reusable "user-management" module which was written using Spring/Hibernate(using Doman-Model Pattern).We have used that module in several project integrating with Wicket,JSP and ZK frameworks. Now I am going to develop an application using GWT.I am completely new to GWT and I noticed that the domain obj...

Access control for a services (design decision)

Hi, Let's say we have an interface 'IA' for which we have an implementation 'A'. In our application domain, object 'A' never exists without a container object 'X'. So 'A' is never directly operated upon. 'A' aggregates in 'X'. We don't want to expose 'A' to the outside world. For this we have taken the approach, not to have the public ...

CXF JAX-RS is causing BusException

After adding a RESTFul service using Apache CXF to my Spring (and Wicket) project I get the following exception: org.apache.cxf.BusException: No binding factory for namespace http://apache.org/cxf/binding/jaxrs registered. I have included the row below in my Spring configuration and thought this would actually solve my problem. But it ...

spring: add xml context on-the-fly?

I'd like to be able to load spring context.xml files on-the-fly, so that they are wired with previously loaded contexts (meaning, in contextA.xml I can ref a bean defined in contextB.xml which was already loaded). I would like for existing beans to not be destroyed and then created whenever a context is added. ...

Setting values from a class to Spring context file

We usually define some beans with their properties in the Spring context file and write some setter methods in the class. Let's say I wanna do the opposite. I have a bean in the context file and want to declare some properties from the class..or initialize values of declared properties in the context from the class. How do I do that? ...

JPA Multiple Persistence Unit bug

Hi folks, I'm trying to add one more database/schema/persistenceUnit in my project and I'm receiving the error: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 2 I google/api allot and could not found why spring is complaining about my configuration. Here is part of my appl...

how long can spring hibernatetemplate createSQLQuery where in(..) can be?

is there any limit of statement i can use where in(1,2,3,4,5,6....) in createSQLQuery in spring hibernatetemplate() ? ...

What is the difference between corePoolSize and maxPoolSize in the Spring ThreadPoolTaskExecutor

I have to send out massEmails to all users of a website. I want to use a thread pool for each email that is sent out. Currently I have set the values to : <property name="corePoolSize" value="500" /> <property name="maxPoolSize" value="1000" /> What is the difference between the two and will it scale. Currently I have approx. 10000 us...

How can I use Spring HibernateOperations for simple operations with a implicit transaction?

Hi all, I currently make heavy use of HibernateOperations in Spring for working with Hibernate. Some of the time I use a TransactionTemplate to demark a transaction explicitly. However sometimes I just want to save/update a single object. If I just call hibernateOperations.save() with no explicit transaction active then it sort of wo...

How to bind CustomDateEditor to all Date fields in Springframework?

I am having a dataBind which is having few attributes alongwith a list of bean and one of the attribute of the bean is of type Date. Now i would like to add the customDateEditor to this date field. My Databind goes like this: public class myDataBind{ /* some attributes here */ List myList = new ArrayList(); // List...

Model generation for manually entered page in Spring framework

I have to extend some Spring web application, but I'm not very familiar with the framework (however, I have some experience with few other frameworks). I can see that there is "ModelAndView" concept used by the framework. Controller returns both: a model and a view from onSubmit() method. But what to do if a model have to be generated fo...