spring

learning Spring's @RequestBody and @RequestParam

Hello, So I'm editing a web project that uses spring and I need to start adding some of spring's annotations. Two of the ones I need to add are @RequestBody and @RequestParam. I've been poking around a little and found this, but still don't completely understand what I'm to do with these annotations. Could anyone give me an example?...

Set System Property With Spring Configuration File

Configuration: Spring 2.5, Junit 4, Log4j The log4j file location is specified from a system property ${log.location} At runtime, system property set with -D java option. All is well. Problem / What I Need: At unit test time, system property not set, and file location not resolved. App uses Spring, would like to simply configure Sp...

Spring's Json not being resolved with appropriate response

I've tried to have a controller in Spring return a JSON response to no avail using the Jackson classes as recommended with 3.0. I've got the jackson jar files(jackson-core-asl-1.5.5.jar & jackson-mapper-asl-1.5.5.jar) in my class path of course. As for the appconfig.xml entries, I'm not sure I need these. I've put them in there as a las...

Execute a piece of SQL on JDBC connection setup in Spring

I want to execute an SQL statement on setup of each database connection. I'm using Spring 2.0.2 and org.apache.commons.dbcp.BasicDataSource from Apache Commons DBCP 1.2.1. BasicDataSource seems to have property connectionInitSqls, but only in the newer version... anyone knows a way to set something like that in the older version? This i...

Spring Remoting - HTTP Invokers

Hello! What do you think of Spring's HTTP Invokers? I'd like that two Tomcat servers exchange objects, exposed by a service, through HTTPS. Do you think that Spring HTTP Invoker is a good choice? Thx ...

Need to verify the older way of defining handler mappings using mvc:annotation-driven?

In an app I'm looking at I find this in the dispatcher xml: <mvc:annotation-driven /> Am I correct that this is the Spring 3 way of defining handler mappings (url routes). One of the controllers in the app looks like this: @Controller @RequestMapping("/order") @SessionAttributes(OrderController.ORDER) public class OrderController { ...

Invalid Cursor State on every query JDBC, Spring, Derby. Configuration problem?

Hello! I am just getting started with Spring (MVC,Webflow etc etc) and I am trying to write my own small web application. As a database I am using Apache Derby which I set up though the Eclipse Database Developer plug-ins. Now my problem: Everytime I fire queries through the JDBCTemplate I get an "Invalid cursor state" exception at ru...

What's the difference between ModelAndView and ModelMap?

Is ModelMap just the new name in Spring 3 for a ModelAndView? Does the functionality change in Spring 3? Consider this code in a Spring 3 app using a ModelMap: @RequestMapping(value = "/order", method = RequestMethod.GET) public final String setup(final ModelMap model) { model.addAttribute(ORDER, new Order()); return "setup"; ...

Dojo caching issue in Spring

I am having an issue where dojo seems to be caching html and then not properly redisplaying it. If I call this function once it works fine, and it works on all subsequent calls if the parameters are unique. If I call it twice with duplicate parameters then essentially nothing happens. I'd appreciate any help. function findN...

When does it make sense to use Spring WebFlow on top of Spring MVC?

Spring MVC has become a very popular framework for building enterprise web applications. Any complex web application has certain flows that need to be coded, including some conditional flows (i.e., show order processed if the credit card information was correct, or validation errors if something was not entered correctly). When does it...

How to use Servlet 3 @WebServlet & async with Spring MVC 3?

I wanna integrate the servlet 3.0 async support with spring MVC. Something like: @RequestMapping("/chat") @WebServlet(name="myServlet", asyncSupported=true) public String getMessage(String userName) { ...... } is it possible? ...

How does Spring 3 map the form-post in this jsp?

At line 17 of login.jsp, there is the following line of code: <form action="/login/submit" method="post"> What I can't determine is where Spring submits this form to. In the corresponding LoginController.java, I don't see any mapping to the URL '/login/submit' such as this: @RequestMapping(value = "/login/submit", method = RequestMe...

spring 3 | show binding errors next to each input

Hi @all! My first question as a spring newbie: How do I show validation errors NEXT to each input/component? Validator: @Override public void validate( final Object obj, final Errors e ) { ValidationUtils.rejectIfEmpty( e, "firstname", "error.firstname.empty" ); } JSP: <form:label path="firstname"> <spring:message code="labe...

hibernate see slow query

inside hibernate.property. is that any parameter i can set to see all the slow query that take too much time to return result? i'm using spring-hibernate applicationContext.xml ...

Spring Transactional Management - Where to Place the Annotations?

If I have a transactionally managed class, in which I have two methods e.g void OuterMethod(Data somedata) { this.InnerMethod(somedata) } @Transactional("mymanager") void InnerMethod(Data somedata) { //writes some things } is this valid? I can't get it to write to the database for some reason, although it doesn't give me any...

Spring @transactional does not start a transaction while testing with JUnit4

I have following configuration. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5....

listener failed to start a dedicated server process

my spring-hibernate application run without problem for the past 1 week, but suddenly i get below error. will this caused by configuration error in applicationContext.xml? there is no error on my oracle10g log files (i get below errror every 1-2weeks once) 28 Jul 2010 14:20:19,177 INFO [http-2020-19] - Loading XML bean definitions from...

Why does my Spring AOP aspect work in my unit test but not my webapp ?

I have an aspect working correctly in my unit tests, a log message is printed from the actual method, and afterwards from the aspect applied. When running my webapp though, I only see the result of the '@afterReturning' advice applied, my method does not execute first. My config: <beans xmlns="http://www.springframework.org/schema/be...

Spring AOP - Pointcuts not triggering

I am just getting started with Spring AOP in my project and am having some problems with getting Spring AOP working correctly. I have two objects, TransportImpl and SesssionImpl that I would like to profile via AOP. Both objects(beans) are initialised via Spring. Both beans are implementations of business interfaces (Transport and Ses...

Spring Build Problem - Can't Find Beans Schema

I'm using Maven2 and Spring 3, when I run my project in Eclipse everything works fine, but when I use assembly:assembly, the resultant jar throws the following Exception: Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 4 in XML document from class path resource [beans.xml] is inva...