spring

Different bean configuration depending on runtime?

Hello. I have a bean, say manager, which is used all over my application for remoting. The bean is using httpclient which in turn can be configured with or without proxy. But this configuration can be only one. What i want in my application is: when the application started, the user is asked does she want to use a proxy or not? And depe...

Dynamically binding lists with Spring's form tag

Hello, I have a command object FaxForm and it holds a list of FaxStatus objects inside a faxStatusList property. public class FaxForm { private List<FaxStatus> faxStatusList; public void setFaxStatusList(List<FaxStatus> faxStatusList) { this.faxStatusList = faxStatusList; } public List<FaxStatus> getFaxStatusList() { ...

Learning Struts, Spring and Hibernate

I'm trying to learn Struts, Spring and Hibernate, I was just wondering if anyone knows any good sources or some examples that makes use of all the technologies (like a small web application). Thanks. ...

JRuby app throws exception in Spring

I am trying to run a JRuby app in Spring. I use Eclipse to run it. But it doesn't compile. Does anybody know what's going on here? Exception in thread "Launcher:/oflaDemo" [INFO] [Launcher:/oflaDemo] org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support...

Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace

My setup is fairly simple: I have a web front-end, back-end is spring-wired. I am using AOP to add a layer of security on my rpc services. It's all good, except for the fact that the web app aborts on launch: [java] SEVERE: Context initialization failed [java] org.springframework.beans.factory.parsing.BeanDefinitionParsingExce...

How to create background process in spring webapp?

I want to run background process in parallel with my spring-mvc web-application. I need a way to start in automatically on context loading. Background process is a class that implements Runnable. Is spring-mvc has some facilities for that? ...

hibernate search + spring3 + jpa

I'm trying to integrate hibernate search in my project. My models are indexed, but for some reason my search queries do not return any results. I've been trying to solve this issue for a few hours now, but nothing I do seems to work. Domain object: @Entity @Table(name = "roles") @Indexed public class Role implements GrantedAuthority { ...

Jersey implementing ContextResolver<JAXBContext> in Spring

So I am writing a Spring(2.5( + Jersey(1.1.4.1) and trying to create a JSONConfiguration using a ContextResolver. Here is the code: package com.rhigdon.jersey.config; import com.sun.jersey.api.json.JSONConfiguration; import com.sun.jersey.api.json.JSONJAXBContext; import javax.ws.rs.ext.ContextResolver; import javax.ws.rs.ext.Provide...

how to map "a-b" query to a command object in Spring MVC

Hello, I used to use "@RequestParam("a-b") String foo" to receive the "a-b" parameter from http query. now I want to switch to Command Object, but I don't how to receive this param, I tried following 4 forms "ab", "aB", "a_b", "a_B", but neither works, for example, the following code will result as URL: http://localhost:8080/test1?a-b...

Replacing EL in JSP with SpEL from Spring 3.0

Tired of old EL in JSP not being able to invoke methods on beans etc. Can I use SpEL from Spring 3.0 in my JSP:s? ...

H2 database In memory - Init schema via Spring/Hibernate

I have a Spring/Hibernate application with H2 database and I have a few issues with configuring H2 to run in an embedded mode (in memory): 1. I want spring to start the H2 database so I created the following Spring beans: <bean id="org.h2.tools.Server" class="org.h2.tools.Server" factory-method="createTcpServer" init-method="sta...

Hassle with Hibernate and Spring and Dynamic Proxies

Hi, I would like to implement something like a PDO pattern in conjunction with Spring. All domain objects are implemented according to their interface. Each domain object implementation also has an autowired DAO implementation to be able to directly persist the object. (e.g. foo.persist()). This works pretty well, Spring also inserts th...

Multiple messageSources in Spring configuration files

Hi, our web application uses Spring 2.5. It consists of several modules, each of which can bring additional Spring context files, which are loaded automatically (into one application context). We want to let each module provide additional resource bundles (for I18N support). Spring supports internationalization by registering a bean wi...

How does Wicket's @SpringBean annotation work?

How does Wicket's @SpringBean annotation work? Does it use reflection at run time? Does it make the compiler inject some code? Or what? ...

spring - hibernate load *.hbm.xml from classpath resource

I have some hbm.xml files in classpath resource located in src/main/resources maven's folder. I used spring's LocalSessionFactoryBean to load these files with the following bean config: <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSourceOracl...

synchronized method or use spring @transactional?

I have a method that will be used to send out email. i want to lock this method so only one thread can accses it per time and the rest pool up concurrently. should i synchronized the method or use spring @transactional PROPAGATION_REQUIRED ? in my service layer //each time use new thread to send out email public void sendThroughSMT...

Is learning Java and related technologies worth it today?

My career has always been C and C++ programming. I have some basic Java experience. I have a lot of personal Ruby/Rails experience and lately I've been doing some Grails stuff at work as well. I'm just curious if it's worth it to pick up Java and related technologies such as Spring, Hibernate, etc... Grails seems like it removes the n...

problem in Spring session scope bean with AOP

Hello, I want to inject currentUser instance in HomeController class. so for every request, HomeController will have currentUser object. My configuration: <bean id="homeController" class="com.xxxxx.actions.HomeController"> <property name="serviceExecutor" ref="serviceExecutorApi"/> <property name="currentUser" ref="currentUser"...

How to address properties with "." in the key name in spring 3.0 @Value tag

@Value("#{myProperties.prop_part1_part2}") works but @Value("#{myProperties.prop.part1.part2}") Doesn't. How do I address a property with "." in the key ? ...

cannot get clob datatype from database into JPA entity

I able to save (spring-hibernate saveorupdate()) field @Lob @Column(name = "FILENAME") private String filename; into oracle database datatype is clob but when i try retrieve it, i get error ERROR - JDBCExceptionReporter.logExceptions(72) | ORA-00932: inconsistent datatypes: expected - got CLOB below is how i retrive ...