spring

caching spring/hibernate webapp

I have a website that allows searches for lists of content in various ways, for instance "show stuff created by user 523 ordered by date" or "show a list of the most recent 10 posts." I use Hibernate for my ORM, and Hibernate provides a cache for objects. For lists of objects, though, like the front page list of most recent content, I'...

Inheritance and subflows with Spring WebFlow in grails

Spring WebFlow supports some advanced reuse features like flow inheritance and subflows. Using this features in SWF xml definitions is pretty easy, for example: <flow parent="parent"> <subflow-state id="addGuest" subflow="createGuest"> Can I use these features with weblflows in Grails? Can I define these using the SWF groovy dsl? How ...

Mail for Blackberry's - multiple content attachments

Hi - We'd like to send a single email which has "multiple contents" attached. Scenario is that we'd like one content to be displayed if the email is read using a Blackberry and another content displayed if the email is read in a desktop email client. (Blackberry content would be just text, other devices should read the HTML content in...

Servlet "newspring" is not available

Trying to set up a new spring project and im having this issue where I get this error (HTTP Status 404 - Servlet newspring is not available) when I navigate to a page that I expect to get routed through to a controller. web.xml <servlet> <servlet-name>springapp</servlet-name> <servlet-class>org.springframework.web.servlet.Dispatcher...

Creating temporary JMS jms topic in Spring

I'm trying to refactor some legacy code to use Spring to handle the jms connections to a mainframe service. I need to connect create a temporary topic for the mainframe service reply and set that as the message.setJMSReplyTo(replyTo); in the message before I send the message. Can anyone provide examples of this? I have not found anythin...

Out of Memory Error in Eclipse

Hi. I am trying to install Spring framework in my eclipse ganymede through an update site http://springide.org/updatesite. But when it updates an error will occur in my ide which says that an out of memory error occurred. ...

Faces conversion service is not found for converting 'dataModel'

While creating my first swf application with JSF integration, I get the following error : Unable to load class 'dataModel' when parsing my flow definition on the first request. It appears that the FacesConversionService (the class that understands the 'dataModel' alias) is not invoked while trying to find a class for that alias, althoug...

What are the Gang-of-Four(GoF) Design Patterns used in the Spring Framework?

Spring Framework is a lightweight dependency injection and aspect-oriented container and framework. AspectJ is a seamless aspect-oriented extension to Java, which means that programming in AspectJ is effectively programming in Java plus aspects. As AOP introduces its own terminology, Spring has adopted it for the sake of consistency wit...

JdbcTemplate batch update in postgresql - date loses time?

I am inserting a list of object with java.util.date in format YYYY-MM-DDThh:mm:ssTZD (2008-09-26T14:34:59+02:00). SQL: INSERT INTO cdate (key,valuedate,user_id) VALUES(?,?,?) BatchPreparedStatementSetter bpss = new MetaJdbc().setMetaBatchPreparedStatement( list, userId); getJdbcTemplate().batchUpdate(sql,bpss); Date is...

java generics type parameters and operations on those types

In searching for an answer to an interesting situation which I had recently encountered I came upon the following question: Type safety, Java generics and querying I have written the following class (cleaned up a bit) public abstract class BaseDaoImpl<T extends Serializable> extends HibernateDaoSupport implements BaseDao<T> { /** ...

Is there a Spring HandlerAdapter implementation for Struts?

This is just a curiosity question. I know that Spring can be used in a Struts ActionServlet (sp?) via certain means, but I was wondering if there was a HandlerAdapter that allowed old Struts code to be ported immediately to a Spring DispatcherServlet to use the DispatcherServlet as the front controller. ...

How to implement Abstract Factory pattern in Spring-AOP?

Is implementing the Abstract Factory pattern for a spring-based project with AOP should be any different than in a normal project? ...

Reading a list from a java .properties using Spring properties place holder

Hi there, i want to fill a bean list property using Spring properties place holder. Context file ------------ <bean name="XXX" class="XX.YY.Z"> <property name="urlList"> <value>${prop.list}</value> </property> </bean> Properties File --------------- prop.list.one=foo prop.list.two=bar Any help would be much ...

Dereferencing Aliases in LDAP using Spring

How to control LDAP Alias Dereferencing Mode using Java and Spring LDAP API? Similarly to how it is done using ldapsearch on linux. Example: ldapsearch -a never "(&(o=foo)(cn=bar))" cn ldapsearch -a always "(&(o=foo)(cn=bar))" cn ...

Spring's PropertyPlaceholderConfigurer with property in a jar file

I have multiple property files I need to refer to. Below I can refer to two that are on the classpath. How do I refer to a property file with in a jar file ? <bean id="placeholderConfig" name="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <...

Accessing jax-rs (CXF) MessageContext outside service class in Spring (2.5)

Hey All, I'm trying to access the MessageContext (or WebServiceContext) in an aspect to get access to the HTTPServletRequest for logging purposes. I would like to inject the context like I did for spring-ws but I have not found a way to do it. Here is what I used for spring-ws: <beans:bean id="transportContext" class="org.springframewo...

Spring syntax for setting a Class object?

Is there a way to set a property in spring to, not an instance of a class, but the class object itself? i.e. Rather than <bean> <property name="prototype" class="a.b.c.Foo">... giving you an instance of "Foo", something like: <bean> <property name="prototype" class="java.lang.Class" value="a.b.c.Foo.class"... edit: best (wor...

Relative paths in spring classpath resource

Hi all, I have a bunch of spring config files, all of which live under the META-INF directory in various subpackages. I have been using import like the following... <import resource="../database/schema.xml"/> So a relative path from the source file. This works fine when I am working with a local build outside of a jar file. But ...

Strange Spring behavior on Jetty when spring.jar is in WEB-INF/lib/ instead of classpath

I'm running Eclipse with the run-jetty-run plugin to launch my J2EE web apps. My project uses Spring, and the spring configuration uses things like HttpInvokerProxy and properties placeholder. When the spring jars are on the classpath (I mean configured in the "classpath" tab of the "run configuration") and external (not in WEB-INF/lib...

creating spring bean

Is there a way to write a Spring bean in XML so that it uses constructor which doesn't need an argument. For instance: public class CronSchedule { public CronSchedule() throws Exception { SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler(); JobDetail jd = new JobDetail("job1", "group1"...