spring

Spring Framework : Populating a Map<Enum,Object> with util:map

I have this factory class, which i want to wire via spring for runtime configuration of the map. The map contains an enum object and standard pojo. public class GenericEntityFactoryImpl implements GenericEntityFactory { private Map<IndexType,IEntity> indexEntityMap = null; @Override public IEntity getIndexEntity(IndexType ...

Transactional Executor with Retry?

Please a bit of advice on the following: I am using a ThreadPoolTaskExecutor to execute slow-external tasks like sending emails. I need to improve this: 1) When the a task is passed to the exeuctor, it has to wait executing it till at least the transaction of the passing operation has finished. Example: i makes no sense to email someth...

Transaction on postgresql not comitted, mapped objects are not being persisted with autoCommit=false

Mapped objects are not being persisted in DB (Postgresql 8.4) when calling persist in a running transaction. I am using Spring Transaction Management with the org.springframework.jdbc.datasource.DataSourceTransactionManager so everything should be fine. I set the autocommit-mode on the DataSource to "false". When setting the mode ...

Tag Libraries for Spring MVC

Hi folks, I'm writing a web application using Spring MVC. Although Spring MVC comes with a couple of tag libraries, they are not rich as Struts' counterpart. What I miss most is <html:xhtml>. Those of you using Spring MVC, what third-party tag libraries do you guys use? Thanks! Edit: More specifically, I would like to auto-generate t...

Spring JDBC DAO

Hi! Im learning Spring (2 and 3) and i got this method in a ClientDao public Client getClient(int id) { List<Client> clients= getSimpleJdbcTemplate().query( CLIENT_GET, new RowMapper<Client>() { public Client mapRow(ResultSet rs, int rowNum) throws SQLException { Client...

Spring-WS SecurityInterceptor operation level

Hello, I have a Spring-WS service using PayloadRootAnnotationMethodEndpointMapping that has several interceptors: <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"> <property name="interceptors"> <list> <ref local="loggingInterceptor"/> <r...

How to access a ServletRequest from inside a singleton spring bean?

I have a singleton spring bean that is being invoked in response to some client side action. I wish to capture some information about the client (specifically the IP address). I assume the best source of this information is the request object. How do I obtain access to the request object from inside my bean? Forgive me if this is an obv...

How can I serve i18n messages from database effectively

I'm using latest versions of Spring Framework and Hibernate. I know how I can create custom version of MessageSource. But what would be best way to serve i18n messages. Because if I query database every time application needs internationalization, it will cause huge amount traffic to database, and often queries will just return same answ...

Spring session scoped bean in EJB 2 Stateless Session Bean

I'm adding some features to an old EJB 2 application using Spring. The Spring application context used by the EJBs is a parent context of the web application as described here. I'm trying to use a session scoped bean from within the EJBs. The bean in question is initialized from the EJB application context. However, I get this error ...

Add Error on GET METHOD Spring annotated controller

Hi All, Please help me with what I want to do. I have this scenario: I display a list of assets to users. User selects an asset and then clicks add item On my requestmapping, during GET operation. I use the service class to check if indeed this asset still exist in DB If not, user should be notified by a message. I use the form:err...

Stripes, Spring, Play (or ?) : which high performance Java framework to use ?

We are beginning to build out a webapp which will probably see a lot of traffic. We dont have a lot of money, so we want to reduce hardware cost. More or less, I think that means we will try to be as stateless as possible (as the Wicket way suggests - have bookmarkable URLs, etc. etc.) The other problem is that we are gonna be hiring co...

Spring - remove a validation error?

Hi, In the context of Spring Webflow 2.0.x...... Is it possible to REMOVE a validation error from within the Spring Errors object during validation? I cant see anything in the API. i.e. public class MyValidator implements Validator { ....... public void validate(Object target, Errors errors) { MyForm form = (MyForm) t...

Disable Spring from Starting up after BeanInstantiationException (Tomcat)

Hello, for the project I'm currently working at there is the requirement to disable the webapp context to be started when spring fails to initialize some beans (that call webservices during initialization and therefore are likely to crash then). However, when a bean throws any exception during initialization, it looks like this: org...

Request parameter is null calling methods on MultiActionController

In Spring 3.0 if i have a jsp page with two different links each calling different method on MultiActionController <form:form method="POST"> <a href="user.htm?action=add" style="color: blue;">Add</a> <a href="user.htm?action=delete" style="color: blue;">Delete</a> </form:form> on the MultiActionController i get request param...

Webflow2: cant bind view with model

Hi Could someone help me understand what am I missing in binding the view with model? Here is the error I am getting: org.springframework.binding.expression.PropertyNotFoundException: Property not found at org.springframework.binding.expression.ognl.OgnlExpression.getValue(OgnlExpression.java:87) at org.springframework.webflow.mvc.view...

spring mvc security. user login on every page

I want to store user information after logging in and to display my login and username on every page (using jsp). How can I get access in my jsp views to the session bean that would store information of the user that is logged in? ...

Spring MBeanExporter: Log an exception's stacktrace

In Spring MVC, an exception's stack trace is logged if it makes it all the way back up to the framework (for example, if there is a NullPointerException). Is there a simple way to do this using Spring's MBeanExporter? I know that I could have try-catches in the method to do this, but that would lead to clutter. I checked the Spring doc...

Can I run Webflow 1.0 flows through Spring Webflow 2.1.1?

I have a project built with Webflow 1.0 and Spring 2.0. We'd like to upgrade to Spring 3, but that requires Webflow 2.X. I've updated all the Spring and Webflow jars in the project, but when I try to load the initial flow, I get: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot ...

Using AbstractExcelView from a portlet

Hi Experts, how can i use spring AbstractExcelView to generate a excel file in a portlet Thanks Sam ...

How do you handle an Ajax.Request call in a Spring MVC (3.0) app?

I have the following call in my JavaScript: new Ajax.Request('/orders/check_first_last/A15Z2W2', {asynchronous:true, evalScripts:true, parameters:{first:$('input_initial').value, last:$('input_final').value, order_quantity:$('input_quantity').value}}); What do I need to do to get Spring MVC (3.0) to handle this? ...