spring

Is there a way to map an URL to another URL in Spring?

In Struts 1 you could have, in struts-config.xml, a declaration like: <action path="/first" forward="/second.do"> Is something similar also possible in Spring, or can I map an URL only to a controller? I am using Spring 2.5.x. I could off course map the URL to the same controller as: <bean id="urlMapping" class="org.springframework....

Flex Spring Integration

Where should we declare the destinations and how to link applicationContext.xml and remoting-config.xml file? ...

How negligible is ParameterizedBeanPropertyRowMapper's performance hit?

The javadoc says: Please note that this class is designed to provide convenience rather than high performance. For best performance consider using a custom RowMapper. How slow is it in the real world? ...

Dependency Injection by type using generics - how does it work?

Using Spring, I can get all beans of a certain type that are currently defined using this: @Resource private List<Foo> allFoos; How does Spring do this? I thought type information of generics was erased at runtime. So how does Spring know about the type Foo of the list and only inject dependencies of the correct type? To illustrate: ...

Spring, db and property file configuration.

I have some JDO objects that I want to spring to configure with info from a property file. But since spring isn't used to create (i.e these objects are not listed as beans in the xml. Should they, how would it look?) these objects how can I get it to configure those objects? Only solution I can come up with is to have the property fil...

Decoupling backing store with Spring Web MVC

This is a design pattern question, so I'll illustrate it with a simple example of an address book app. Firstly a few assumptions. 1. It appears to be acceptable to directly use DB domain objects as the backing store for Spring MVC forms. Iteration 1 of my app I created a JPA mapped Person object with various attributes attached. Using ...

Spring JdbcTemplate returns empty result when there should be a valid result

I'm using SimpleJdbcDaoSupport object to access DB resources. I have a query which is frequently executed against the database to locate a record with a specific key. for some reason after executing the same query several times I start to get an empty result even though the record exists in the database. Any ideas what can cause this b...

.persist() returns no errors, but where is my persisted data?

Hi, In my DAO implementation I'm doing Stripersist.getEntityManager().persist(client);, this doesn't seem to return any errors, but I can't find the data that it persists. My client object looks like this : @Entity public class Client implements Serializable { @Id @GeneratedValue private Integer id; @Column priva...

JTA: how to be test JMS and JDBC failures?

Hi all, we're currently working on testing JTA failure behaviour, on a system that receives messages using JMS, persists them, and sends results using another class. The whole thing is tied together using Spring. Current unit tests use HSQLDB, Apache ActiveMQ and Bitronix for transaction management. Success with this has been limited, ...

maintain state with spring between requests.

Hi, I am new to spring so sorry if this is a beginners question, but the manual is not clear (at least not for me) My question is: how do I share state between requests in spring? I can send data from the controller to the view by using a ModelMap, but the data in the ModelMap is not sent back to the next controller by the view. How can...

Interoperability by using Spring and Hessian ? Is it possible ?

Hi, Spring in Action book says: Hessian, like RMI, uses binary messages to communicate between client and service. However, unlike other binary remoting technologies (such as RMI), the binary message IS PORTABLE to languages other than Java, including PHP, Python, C++, and C#. (316) Can you give me some advice how can i get it ? T...

ANT replace task - not picking up modified value from properties file

I'm using Spring and struts and have the following entry in 'C:/source/webapp/WebContent/META-INF/context.xml' with tokens like 'jdbc.username, jdbc.pwd, jdbc.server, jdbc.port and jdbc.databasename'. <Context cachingAllowed="false" useHttpOnly="true"> <Resource name="jdbc/xxx" auth="Container" type="javax.sql.DataSource" ...

How do you uninstall the Scala Eclipse plugin?

I tried to install the Eclipse plugin advertised in the Scala advertised at http://www.scala-lang.org/node/94. I installed it onto my version of the SpringSource Tool Suite 2.2.1 thinking everything would be fine. I'm still using Mac OS 10.4, and thus have not upgraded to Java 6. Lo, and behold, I was wrong. I can't even restart STS an...

Spring Hibernates session issue with http request

Hello there, I too have the same situation and i had configured the OpenSessionInViewFilter like this in my web.xml. <!-- Hibernates session management for request --> <filter> <filter-name>hibReqSessionFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> ...

WAS 6.1, JPA with JTA, Hibernate, Spring : data retrieval problem

I'm running an application with the following components: Oracle 9i WAS 6.1.0.23 with WS and EJB3 features pack JPA with Hibernate 3.3.2.GA as provider (with Hibernate-EntityManager 3.4.0) Spring transaction manager for WAS : UowTransactionManager (spring 2.5.6) Spring webflow with flow-managed persistence (2.0.8), i.e. the entity mana...

Using JSF, JPA and DAO. Without Spring?

Hi, till now i still worked with JSF and JPA without DAOs. Now i'd like to use DAOs. But how can i initialize the EntityManager in the DAO-Classes? public class AdresseHome { @PersistenceContext private EntityManager entityManager; public void persist(Adresse transientInstance) { log.debug("persisting Adresse inst...

Is there an easy way to validate that a Spring Webflow (1.0.x) has proper outputs in an attribute mapper that occurs in an end state from within an integration test?

I have several integration tests that test the execution of flows for subflows. However, I would like to be able to examine the mapped output attributes of the subflow when it ends. Is there an easy way to do this for Webflow (1.0.x)? For the record, my tests are a custom extension of AbstractXmlFlowExecutionTests, so pretty much anyt...

How to register multiple servlets in web.xml in one Spring application

I want to define two servlets in my Spring web.xml - one for the application html/jsp pages, and one for a web service that will be called by an external application. Here is the web.xml: <servlet> <servlet-name>myservlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-star...

Setting createdBy and updatedBy in JPA entities automatically

Hi everyone, I'm working on a JPA (Hibernate implementation of), Spring and Stripes web app. I have a number of JPA entities that have the following fields in common for both audit and query purposes: createdBy - the user ID of the person who created the entity. createdOn - the date the entity was created updatedBy - the user ID of the...

Using Spring ContextLoaderListener in JBoss config with default wars

I'm trying to use Spring to configure a web app deployed in JBoss. I've added this to the web.xml: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> However, I've based my config on the 'default' JBoss config that includes wars such as jmx-console.war, and now these fail t...