Tag Archives: Spring

Spring @MVC 3 cascading selects using jQuery

I’d be rich if I had a dollar for each time I heard someone ask “How do I dynamically populate a drop down menu based on the current selection in another drop down?” Actually that is probably the poster child usage of AJAX. You can certainly use raw AJAX to accomplish this (just ask the [...]

Posted in jQuery, Spring Framework, Spring MVC | Also tagged , | 9 Responses

Spring MVC 3 Showcase

SpringSource member Keith Donald has announced that he is providing simple demos of new additions to Spring MVC version 3. This is a Maven project containing all the demos. The samples Subversion repository is: https://src.springframework.org/svn/spring-samples/ so you can grab the source like this: svn co https://src.springframework.org/svn/spring-samples/mvc-showcase/ There is also a screencast you can watch.

Posted in Spring Framework, Spring MVC | Also tagged | Leave a comment

jetty maven version 7 beta woes

So I gave the beta of the jetty maven plugin a try. What I had was this: 1 2 3 <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.19</version> I changed it to this which is the most current available version in the repos: 1 2 <artifactId>jetty-maven-plugin</artifactId> <version>7.0.0.1beta3</version> N.B. for maximum cognitive dissonance the jetty guys thought it would be a [...]

Posted in Maven, Spring Framework | Also tagged , | 1 Response

Spring, BasicDataSource and OpenJPA

So you want to use Spring with commons BasicDataSource and OpenJPA? There is an interesting gotcha. Let’s start with just the DriverManager DataSource for comparison. In your spring context you define the datasource like this: 1 2 3 4 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="org.hsqldb.jdbcDriver" p:url="jdbc:hsqldb:hsql://localhost:9001/testdb" p:username="sa" p:password="" /> Then your EntityManager Factory: 1 2 3 [...]

Posted in JPA, Spring Framework | Also tagged , , | Leave a comment

Spring Test Framework CoC suggestion

Let’s say you’re using JUnit 4 and the Spring Testing classes (the 2.5+ versions) for your unit tests. You can specify parameters as shown in the TransactionConfiguration annotation as shown in this example. But you can also get away with leaving them out in a nod to the uberhip Convention Over Configuration gods as shown [...]

Posted in Spring Framework, Testing | Also tagged , | 1 Response

Spring autowiring Struts 1 Actions

That’s right. Struts 1. Not hip. Not happenin’. But in the real world you might have bills to pay and a pair-programmer to feed. The docs are a bit sketchy with Spring 2.5 stuff. First you set up your service layer in web.xml 1 2 3 4 5 6 7 8 9 <context-param> <description>Used by [...]

Posted in Spring Framework, Web | Also tagged | 3 Responses