spring

What does the @Valid annotation indicate in Spring?

In the following example, the ScriptFile parameter is marked with an @Valid annotation. What does that do? @RequestMapping(value = "/scriptfile", method = RequestMethod.POST) public String create(@Valid ScriptFile scriptFile, BindingResult result, ModelMap modelMap) { if (scriptFile == null) throw new IllegalArgumentExcepti...

GWT Spring Integration - How to do AOP logging?

I have a GWT application where its RPC services are handled by a GWTHandler bean so that it can integrate with Spring smoothly. The application works. No problem with that. My issue is I can't do any AOP logging with Spring. I like to log user activities from the GWT interface using AOP. (I could of course do it the old way of calling ...

Why I cann't use Spring and Blossom annotations?

I use Magnolia CMS and Blossom. When I add annotations to my classes I get something like this: annotations are not supported in -source 1.3 (use -source 5 or higher to enable annotations) @Template(value="Blossom Template")* Spring annotation(like @Controller) doesn't compaile too. Where is my mistake? My pom.xml dependenc...

how can i automatically generate a non id value in hibernate?

I am using hibernate annotations, spring, a sessionFactory and defining everything in a context.xml (like so..) <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="myDataSource" /> <property name="annotatedClasses"> <...

Tomcat/Spring no longer sending emails to SMTP server using authentication

I've got a strange problem with either tomcat or spring. I put up a major revision to my site and emails are no longer being delivered. I use authsmtp, which requires authentication (so they can properly account for my using of their services). No problem, I have this config in spring: <bean id="mailSender" class="org.springframework...

How to send an event to another bean in spring?

In spring it is possible to do this. Does anybody have code samples? ...

Server side Exception or error to be propogated to JSP in Spring

Hi folks, I am trying to show an custom error message on any occurance of exception or error in my business layer. I am catching the exception in my controller and I would like to display it in my JSP. This exception or error is not associated with any field in the screen, its a pure server exception. I am also using an Annotated Contr...

Can the object created in IoC container be called Singleton. If not - why?

can the object created in IOC container can be called Singleton if yes why if no why? Can anybody explain me in detail in simple words how IOC conatiner exactly manages the objects.. ...

Interceptors vs aspect in spring?

hello all, am trying to use interceptors in spring, i want to implement an interceptor on some methods, to handle specific logic when these methods called, i want also to be apart from using web framework, as am tending to use spring as back end, without any headers, after searching i think spring approach is called Aspects, could you ...

Spring validation with Struts 2

I am considering using Spring Validation for my application for reuse purposes. I created a validator that implements org.springframework.validation.Validator. Is it possible to configure this to work with Struts 2 validation? ...

How to configure Spring to call an image serving servlet from the dispatcher servlet?

I've written the code for a servlet to serve images in my app from a url such as: /imgsrv?imgid=12345 So this would be one additional servlet in the app besides the Dispatcher servlet. The problem is, I don't know how do you configure Spring to call this new servlet from the Dispatcher servlet? ...

Looking for a tutorial using MyEclipse 8.6, Spring, Hibernate

I just installed MyEclipse and have not located a tutorial using MyEclipse with Spring 3 and Hibernate. I would appreciate it if anyone could refer me to such a tutorial. Thanks. ...

Bean property 'transactionManagerBeanName' is not writable or has an invalid setter method

I am trying to configure Spring3 + JPA using Hibernate, but I am getting an exception while spring tries to create a Bean called TransactionInterceptor, the exception is attached. Any help is welcome. I am sending my app-config.xml, my persistence.xml and the error stack trace below: My app-config.xml <beans xmlns="http://www.spri...

when we load hibernate using spring we have to just call methods for CRUD function

when we load hibernate using spring we have to just call methods for CRUD function but what exactly Spring hibernate do to fire query ...

HowTo extend Spring Annotation @Transactional

I have to use 3 different transaction managers in my webapp. So I wrote my own Annotation according to the Spring reference (Section 10.5.6.3 Custom shortcut annotations). One annotation (for using one specific transactionmanager) looks like this: import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import j...

I am using spring to load hibernate, need optimized code for findbyNamedQuery(String query)

I am using spring to load hibernate, need optimized code for findbyNamedQuery(String query) ...

How to get values from property-file into Map using Spring framework?

For now I could inject values from property-files: @Value("${aaa.prop}") public String someProp; But I want something more... For example I have some property file: aaa.props=p1,p2,p3 aaa.props.p1=qwe aaa.props.p2=asd aaa.props.p3=zxc I know for sure, that it contains property aaa.props, and know nothing about other properties. An...

How to add a Filter in Spring (with BlazeDS)

Hi all, I want to add a filter to map a specific path in URL. My server side used Spring 2.5.x, BlazeDS (servlet) with TomCat server. So, my web.xml file is composed like that : <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring-main-config.xml </param-value> </context-par...

Declaring an array of objects in a Spring bean context

I'm trying to create an array of objects in a Spring context file so I can inject it to a constructor that's declared like this: public RandomGeocodingService(GeocodingService... services) { } I'm trying to use the <array> tag: <bean id="googleGeocodingService" class="geocoding.GoogleGeocodingService"> <constructor-arg ref="proxy" /...

Reference Spring properties file using path relative to config file

I am moving properties from inside my Spring config file to a separate properties file. This is included in the config file with <bean class="org.springframework.beans.factory.config.PropertyPlaceHolderConfigurer"> <property name="location" value="file:properties/${CONFIG_MODE}/service.properties" /> </bean> As it stands, the locat...