spring

Wicket + Spring + JPA + Hibernate tutorial

Hi, I'm looking for a step by step tutorial on building small web application using Wicket, Spring, JPA and Hibernate assuming that the programmer is advanced in java but new to those technologies (so if the whole set up was included that would be perfect). Could anyone help? Thanks in advance. ...

Grails 1.3.3 filters - either a NullPointerException or a ClassCastException

Hello, Today I upgraded our grails app from 1.0.3 to 1.3.3 and, of course, things started behaving weirdly. The problem I'm currently asking about is as follows: the web.xml contains: <filter> <filter-name>sitemesh</filter-name> <filter-class>org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter</filter-class> </filter> ...

What is 'weaving'?

I've seen this term when read about how Spring works and I've just read the article about JPA implementation performance and it has the next statistics: EclipseLink 3215 ms (Run-time weaver - Spring ReflectiveLoadTimeWeaver weaver ) EclipseLink (Build-time weaving) ...

SpringMVC How to obtain a bean from session scope when it's constructor is called.

Hey there! I'm pretty new to the Springframework (as you will guess) and ran into a situation, where help is desperatly needed. I do hava a J2EE application here, running on tomcat with lots of old code. Anyway, we decided to use the Spring framework for certain tasks. For example we want to store a security object (containing the usern...

How do I retrieve default validation messages from Hibernate Validator?

I'm trying to retrieve a default validation error-message using MessageSource. The code I'm working with uses reflection to retrieve the value of the message parameter. On a constraint that does not override the message parameter, I would like to retrieve the default error message. When I invoke the message method on the validation annot...

How do I redirect into a new browser window after server side validation suceeds with javascript?

I have a form that needs to put its results into another window. I am using: It has both client and server side validation. The problem is when the server side validation fails, it puts the resulting error screen in the new window rather on the original page (as it should). What I'm trying to figure out is how to have the server sid...

spring 3 ajax call in foreach

Hi @all! I would like to delete elements from a list (foreach) with ajax. I have my "foreach" and put links into each row which link to the controller-element-deletion-method. <c:forEach items="${bean.list}" var="person"> <tr> <td><c:out value="${person.id}" /></td> <td><c:out value="${person.firstName}" /></td> ...

Spring web application developer exam

I am planing to do the Spring web application developer..so may i know what are the prerequisite for this exam? can i directly purchase a voucher and do..i saw in web for prerequisite it stated "Rich Web Training from SpringSource or Certified Partner"..any idea of that traning? is it mandotry? i saw its schedule in many countries but no...

Spring Autowire Dublicate Problems

Hi When trying to autowire JdbcUserDetailsManager from Spring Security, I use following statement in appcontext.xml (located separated from webapp): <bean class="org.springframework.security.provisioning.JdbcUserDetailsManager"> <property name="dataSource" ref="dataSource"/> ...

Multiple Spring IoC Containers

Hi, Is it possible to have two IoC containers in one JVM ? If so, is there a way to use objects created in one container in other using "@Configurable" ? -DKC ...

Java Spring Injection

Hi, I have just started using and educating my self of Java spring. I now know that we can inject beans. But on the look of it it looks like a glorified properties file, am i right in thinking that way ? ...

How do I configure Spring and SLF4J so that I can get logging?

I've got a maven & spring app that I want logging in. I'm keen to use SLF4J. I want to put all my config files into a directory {classpath}/config including log4j.xml and then init using a spring bean. e.g. <bean id="log4jInitialization" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="ta...

Integrating JPA2.0 and Spring

Hello last few hours I try to test with spring jpa 2.0 3.0 Finally I could recover objects persisted but when I try to persist a new object I receive the following error message: org.springframework.dao.InvalidDataAccessApiUsageException: no transaction is in progress; nested exception is javax.persistence.TransactionRequiredExceptio...

How to set a property in spring to a pathname inside of WEB-INF?

I have a class that must be initialized with an absolute pathname. The thing I want to initialize it with the pathname of is a file sitting in WEB-INF. I am using the ContextLoaderListener from Spring to set this all into motion, so I can't run Java code to obtain the path from the context and stick it where a ${whatever} could find it....

HibernateTemplate findByExample returns no results

I'm trying to use Hibernate QBE (actually, Spring's HibernateTemplate.findByExample() ) to return a list of users by their username. I use a "known good" value to search on (the username "JOHN.SMITH" does exist in the database). Unfortunately, I get no results back. Below is the unit test. @Test public void testQueryByExample() { ...

Glassfish and Spring setup tutorials/examples?

Hello, A simple web search didn't really turn up any examples... so I'm wondering if anyone could point me to any information on configuring Spring on Glassfish? Everything I've been finding is horribly outdated. Thanks! ...

Testing CXF and Jersey together causes Spring conflicts?

I have an app that uses CXF as a SOAP client and Jersey to present REST services, with the Jersey classes managed by Spring. This works fine running in Tomcat; however when attempting to test with JerseyTest I get Spring conflicts; it appears JerseyTest doesn't shut-down the Spring context correctly. The test initialisation for Jersey ...

How to catch the exception thrown from an advice

I have my own exeception "MyOwnExeception" and throw this exeception from my service class public void service() throws MyOwnExeception { // some code } Now I want to catch MyOwnExeception in an advice and rethrow a brand-new Exeception public class SimpleThrowsAdvice implements ThrowsAdvice { public void afterThrowing(Method ...

How to use @ResponseBody and @RequestBody?

I reading spring 3.0.x reference but I don't know how to use ,can you paste a full example? ...

Spring MVC: Insert values into all my ModelAndView s

I have a mid-size Spring application and I want to insert key/value pairs into all my ModelAndViews in a cross cutting fashion (much like AOP). The motivation is to add all kind of data to all my pages (configuration values, build number, etc). What is the easiest way to have this done? I prefer without AOP but I am ready to use it if ...