spring

Web user account management components

I need to create user account registration / login / management components for a Spring backed web application. I'm intending to use Acegi to help with the authentication side of things. Is there a framework / set of components that can help with the boilerplate account validation e-mails, forgotten password handling etc functions? Rela...

How to enable circular reference in spring framework?

greetings all sometime in my app the logic forces me to use circular reference and i want to know how to enable this configuration in spring ? ...

How to move location of Atomikos's tm.out and *.epoch files?

I'm running a J2SE application that uses Atomikos which dumps it's numerous log files to the current directory. I'd like to move the location of these files to "/tmp", but I cannot locate a configuration property that I can set from within my Spring XML config file. The Atomikos documentation references a property: com.atomikos.icatch...

Steps to use hibernate in a spring 3 mvc application

Can someone outline the steps required to get hibernate working with spring mvc. I've seen EntityDao's that basically inherit from a GenericDAo. The generic Dao has basic operations like GetAll, GetByID, Save, Delete, etc. And inside their methods they use: getHibernateTemplate So basically the Session has to be wired up in a bean,...

Is it possible to bind/convert the items in a list of a form to a specific type in a Spring Web MVC app?

I'm building a Spring MVC app with Spring 3.0.3. I have data binding of my form working just fine, but one of the form fields is a list of items. Hypothetically speaking, my form object looks like this: public class MyForm { private String name; private List<String> items; public String getName() { return name; ...

OraclePool DataSource: Software caused connection abort: recv failed

I did look at this and this but I dont think they quite answer my question. I have a routine spring web application which uses a connection pool and I use a oracle.jdbc.pool.OracleDataSource. My datasource actually says, <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource" destroy-method="close"> <property name="URL"...

spring write back to property file

Is there something in spring where we can write back to an property file ? Lets say , that we have a property "reportname=SOME REPORT". If we have a GUI where the user can change it to "reportname=SOME OTHER REPORT". Then, is there something in spring that can write that value back to the property file ? Also, is there a xml property...

Using pure servlets (Java Servlet, no framework) in a project using the Spring framework?

We've got some Pure Servlets (pure Java classes following the Servlet API, no framework) that we'd like to include in a project that relies heavily on the Spring Framework. What's the best way of including these servlets in the project, when all the new code we're writing is making heavy use of Spring 3 features? ...

How to EasyMock a call to a method that returns a wildcarded generic?

We're looking at switching to Spring 3.0 and running into problems with the intersection of Spring 3.0, EasyMock, and Java Generics. In one place, we're mocking a Spring 3.0 AbstractBeanFactory, specifically this method: public Class<?> getType(String name) throws NoSuchBeanDefinitionException { ... } Under earlier versions of Spring...

Swappable data layer using spring ioc

I have DAO's for each table, that all implement an interface. Now I want to be able to (potentially) swap database layer implementations. So my strategy is to create a DaoFactory, and this DaoFactory will be specific to a particular implemenation of my DAO's. So I will have DAO's for hibernate. Then a DaoHibernateFactory that will loo...

Opening SSL TCP socket and sending web requests

I have a requirement to open a tcp socket and authenticate using SSLv3 or TLSv1 IP protocol using X.509 digital certificate. What does this handshake process involve exactly? I know the each message should be encrypted and signed with my private key. What else? After successful I've to send POST HTTP requests over the socket. The s...

How do I ensure dependent configurations are initialized with Spring @Configuration annotation?

I am trying to use @Configuration annotations to wire up my application but I keep getting a NullPointerException in one of the initializers because the bean it refers to is not yet initialized (I think). I have tried specifying in the web.xml just the 'root' config class and also tried doing a package scan and neither seem to work. So...

Getting inserted ID after INSERT ... SELECT on Oracle

This SQL statement works if I run it from my Oracle client (SQL Developer): insert into Person (Name) select 'Bob' from dual It also works if I issue it via Spring JDBC, without using a KeyHolder: final PreparedStatementCreator psc = new PreparedStatementCreator() { @Override public PreparedStatement createPreparedStatement(...

spring controller call from javascript. annotations with spring

Is it possible to call a spring controller from javascript included in a jsp? I'm trying to call it like this: form.action='${pageContext.request.contextPath}/spring/myController'; I can see that the control passes throught the lines, but nothing is happening. Also I get messages like get or post is not supported. when I submit the ...

How to do something on session start in Spring MVC?

Hello everyone. I need to initialize every new http session with some values. How do I do that? I tried to create a session-scoped component and initializing session in @PostConstruct, but session-scoped beans are not eagerly created until I request access them. ...

Select dropdown element with 1 million options, ahem...dependent too

Say we have three dependent select dropdowns (selecting parent asynchronously populates the child via a database query): DD1: [People of this world]     DD2: [Hair Strands]         DD3: [Keratin Molecules] Ok, our options' lists won't be as large as what the names here imply, but each dropdown is going to house about 1 million option i...

Spring 3 Forms + ModelAttribute + Deteched Entity

When saving an entity using Spring Forms and Hibernate I use the following controller method (simplified) to do that. @Transactional @RequestMapping(value="/speichern", method = RequestMethod.POST) public void saveEvent(final @ModelAttribute("__eventData") MDKEvent p_event) { em.persist(p_event); } // saveEvent When I try to edit...

Hibernate - a different object with the same identifier value was already associated with the session

After changing the @id of a Entity from @Id private int getId(){ return this.id; } to @Id private String getLogin(){ return this.login; } I get the error: a different object with the same identifier value was already associated with the session In the webapplication isn't changed anything. A read the entity and then ch...

Spring MVC(Spring 2.5) Question about Post-Redirect-Get

Hi. I have a Spring Annonted Controller that is used to capture the information from a form and get a list of search results from the database. Here is the definition of the method @RequestMapping(method = RequestMethod.POST, params = {SUBMIT_BTN }) public ModelAndView processForm(@ModelAttribute(COMMAND_NAME){ // 1. Load sear...

With spring and hibernate, need clarification on how the datasource and session are wired.

My DAO's are going to extend the HibernateDaoSupport class that spring provides. Now I need to: setup my database connection in web.xml Tell spring I am using annotations for hibernate mapping? wire the session to the HibernateDaoSupport object. The doc's show a sample xml: <beans> <bean id="myDataSource" class="org.apache.commo...