spring

Spring Web: Correct way to have a single default ViewResolver

What is the best way to have every request be sent to a single ViewResolver - specifically in this case a JsonView? Was thinking this: <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.json.MappingJacksonJsonView" /> ...

GWT 2.0 integration with Spring Security 3.0

Hello, I used GWT 2.0 since a few days. So, I try to code an basic application with a login form and a page accessible only if i am logged. Usually in my web application with jsf for example, I use Spring Security 3.0 to configure and secure that kind of application. So, I decided to try to do the same thing with my GWT 2.0 application...

Grails + Spring Security one field login

Hi all Is it possible, using spring security plugin 0.5.3 with Grails 1.2.1, to authenticate a user using only one field? I mean, for example, making j_username and j_password fields in the authentication form equal previous to the authentication. I read it was possible to define j_username field in Config.groovy with acegi plugin, in o...

Spring3 portlets with JSF2

Did anybody ever used the new Spring3 with JSF2 and portlets (JSR286) ? I used JSF1.2 with portlets (JSR168) we had some problems with stuff like file uploading, portlet intercommunication and other stuff. There aren't a lot of resources online on this topic. ...

Integrating JSF with Spring

I haven't implemented any code, I'm still working the overall architecture for a new application and this going to be the first time I use JSF+Spring. I need to put web services in front of the Spring service beans (business logic tier) since these beans could be accessed by other applications besides the presentation tier. While defini...

Spring MVC annotation config problem

I'm trying to improve my spring mvc configuration so as to not require a new config file for every servlet I add, but I'm running into problems. I've tried using this tutorial as a starting point, but I'm running into an issue that I can't figure out. The problem is that when I do a GET to my servlet, I get back a 404 error. Here's my c...

Spring validator default message codes not resolving

Hi all, I have a custom spring validator which has the following default message: public @interface FieldMatch { String message() default "au.com.xxx.website.FieldMatchValidation"; ... The problem I'm having is that the message code is not being resolved and <form:error...> is simply displaying the code rather than the message (W...

write behind cache Ehcache new feature?

Hi, i looking for guide/document/tutorial on how to use this new feature write-behind-cache in ehcache? Is there any demo in spring+jpa+ehcache+hibernate? just to clariyfing, write-behind-cache mean each time we persist entity, it will be written into cache rather than into database correct? ...

Setting custom Post-Login Destinations based on user ROLES using spring security

I want to set custom Post-Login Destinations based on user ROLES in my application. for example : If a form login isn't prompted by an attempt to access a protected resource, I want to show different pages, based on different roles. by using target-url I can't do this. how can I do this by using Spring security ? ...

How to run multiple jobs with spring quartz and the jobs are feched from database.

How to run multiple jobs with spring quartz and the jobs are feched from database. Please provide any example code. ...

How to let Spring initialize "prototype" beans only when it is got through getBean()?

I see that it initializes prototype beans on initial startup. How to prevent this ? ...

Using Spring's KeyHolder with programmatically-generated primary keys

Hello, I am using Spring's NamedParameterJdbcTemplate to perform an insert into a table. The table uses a NEXTVAL on a sequence to obtain the primary key. I then want this generated ID to be passed back to me. I am using Spring's KeyHolder implementation like this: KeyHolder key = new GeneratedKeyHolder(); jdbcTemplate.update(Constan...

How to load a springframework ApplicationContext from Jython

I have a class that loads a springframework application context like so: package com.offlinesupport; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class OfflineScriptSupport { private static ApplicationContext appCtx; public static fin...

Spring 3.0 vs J2EE 6.0

Hi everybody, I'm confronted with a situation... I've been asked to give an advise regarding which approach to take, in terms of J2EE development between Spring 3.0 and J2EE 6.0. I was, and still am, a promoter of Spring 2.5 over classic J2EE 5 development, specially with JBoss, I even migrated old apps to Spring and influenced the r...

Dynamic domain methods missing from grails service when injected into java service in grails app.

I had the idea that I would write my GroovyDao as a grails service. Next I would write a MyJavaService in java and locate it in the java sources dir in my grails app. MyJavaService contains a instance reference to groovyDao for spring injection. I would wire up in resources.groovy the MyJavaService with a groovyDao = ref("GroovyDao")....

Maven/Spring/Java: ClassNotFoundException - but I know class is there...

I have 2 maven projects set up like this: -com.wuntee.rsaAuthenticationManager (jar) -com.wuntee.taac (pom) --taac-backend-gui (jar) --taac-web (war) And 'com.wuntee.rsaAuthenticationManager' is a dep in 'taac-backend-gui'. When running a test case in taac-backend-gui, everything executes fine, but when trying to start the taac-we...

Spring MVC defaultValue for Double

Hi All, I'm trying to build a controller like this: @RequestMapping(method = {RequestMethod.GET}, value = "/users/detail/activities.do") public View foo(@RequestParam(value = "userCash", defaultValue="0.0") Double userCash) { System.out.println("foo userCash=" + userCash); } This works fine: http://localhost/app/users/detail/acti...

AnnotationSessionFactoryBean and singleton scoped bean (Spring framework)

I define a bean of type AnnotationSessionFactoryBean for using in a web-app. If I do not explicitly define it as NOT singleton, it must be singleton. Now, it is bound to the current thread. It means it cannot be a singleton. p.s. Session produced by Factory is not a singleton, SessionFactory on the other hand is always a singleton. N...

Example on Web Service Consumption using Spring if provided a WSDL

Hi Im a newbie to Spring WebServices. I would like to go through a standard example wherein the WSDL is provided as input from Provider. Now how will the client code for this WSDL looks like. Do we need to generate a stub code at client side?? ...

java.lang.IllegalArgumentException: Method must not be null

Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Method must not be null:java.lang.IllegalArgumentException: Method must not be ...