spring

Testing Spring MVC annotation mapppings

With Spring MVC, you can specify that a particular URL will handled by a particular method, and you can specify that particular parameters will map to particular arguments, like so: @Controller public class ImageController { @RequestMapping("/getImage") public String getImage( @RequestParam("imageId") int imageId, Map<String,Obje...

How can I configure a Spring BeanFactory with several bean configuration files?

Hi all, I am sure that the above question has a straightforward answer but I couldn't easily find it (neither in the documentation nor on stackoverflow.com) I got the notion that a BeanFactory/ApplicatioContext can be initialized with several bean configuration files. Is that so? And, if it is how can it be done? ...

How to call Oracle function or stored procedure using spring persistence framework?

Hi, I am using Spring persistence framework for my project. I want to call oracle function or stored procedure from this framework. Can anybody suggest how can I achieve this. Please give solution for both * oracle function and *stored procedure. Thanks. ...

Putting values in error.getModel in onBindAndValidate

I want to add some data to model if there wasn't any validation errors. I thought I could do this in onBindAndValidate, where I have the access to error object, which contains model: errors.getModel().putAll(map); I also tried to put values one by one using put(key, value) but without success. What can I do? ...

Spring JDBCTemplate Table Locking with MySQL

Hi! I just migrating one of our applications from pure JDBC to Spring's JDBCTemplate. I was wondering how to create a write lock for a table. Do i just execute a "LOCK TABLE foo" Query or is there a generalisized way for doing this in JDBCTemplate? Thanks! ...

Spring frame work Wraps Checked Exceptions inside RuntimeExceptions

have this method call -> simpleJdbcTemplate.queryForInt(sql,null); -> queryForInt() method in the springs SimpleJdbcTemplate throws a DataAccessException which is a runtime exception. i want to propegate exceptions to the view tier of the application since Spring frame work Wraps Checked Exceptions inside RuntimeExceptions i ...

Spring- How to use Spring Dependency Injection to write a Standalone Java Application

I want To write a standalone application with IOC,How do i use springs dependancy injection in there. Im using JIdea. There is spring 2.5 support but i want to use spring 3.0 here is the way i tried! I experience in using Spring MVC we can inject dependancies there in a WebApplicationContext but how do i inject dependancies in a st...

Good practice to include XML config in Java classpath?

My application is configured by some Spring XML configuration files. Is it good practice in Java to include the XML files in the classpath, and reference them in my application using the classpath? ...

Spring difference in using bean id and bean name in configuration file

Hi , please tell me if is there any difference in using bean id and bean name in configuration files ...

Which Java framework to use to write a blogging engine?

Hi, I'm planning to write a blogging engine over the summer to learn about web apps & servlets, etc. What would be an appropriate framework to use? I've been told Spring would be good, but I don't know anything about it. Any suggestions? ...

Is Spring ever going to combine MVC and WebFlow?

I thought I read Juergen Holler somewhere once in the past say that a future goal of Spring was to combine Spring MVC and WebFlow... Is this still the case? At the moment they still seem to be fairly separate projects, with WebFlow being recommended as an EXTENSION to MVC. As a developer it would be great if I could use both and defin...

Best way to set HTML head title in a Spring+Tiles2 application?

I have a usability problem in my Spring webapp which uses Tiles as the view technology. At the moment all of the pages display the same HEAD_TITLE and the PAGE_TITLE is page specific: <html> <head><title>HEAD_TITLE</title></head> <body> <h1>PAGE_TITLE</h1> </body> </html> This is a major usability problem as the browsers history...

What's the difference between using @Transactional and Spring template?

If I use @Transactional in my DAO will all of my EntityManager queries be encapsulated with commit and close? Or do I need to use Spring template (JPA template, Hibernate template)? What's the difference between using @Transactional and Spring template? ...

What is Spring's Minimum Dependencies for Dependency Injection?

What are the minimum dependencies required to just use Spring's dependency injection (core framework only)? I'm using Spring for a standalone application, and I'd like to minimize the number of dependencies that I have to ship with the application. I suppose I could systematically remove a Jar and see if the application breaks, but it ...

when using @transactional do i need to use jpatemplate/hibernatetemplate ?

when using @transactional do i need to use jpatemplate/hibernatetemplate ? ...

Spring AOP error

What would cause this problem at run-time?: The matching wildcard is strict, but no declaration can be found for element 'aop:config' Here is the relevant Spring XML: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframe...

How to create a JSON view from a domain object?

I'm creating the server side implementation of an AJAX based web application, where the client side receives responses that are domain objects serialized as JSON. In order to provide a common look and feel, I would like to create templates for different types of domain objects, and re-use these as Spring views for multiple controllers. ...

How to detect unused properties in Spring

I'm working on a Spring 2.0 project, without annotations. We're using several PropertyPlaceholderConfigurer beans with different pre- and suffixes to load properties from different property files. This works beautifully. Because of the large number of property files and properties, I wanted the application to list the properties which a...

What happens if I forget to mark the Spring SessionStatus as "Complete"?

In Spring MVC, suppose I define a SessionAttribute, using the @SessionAttribute tag like so: @SessionAttributes(value = "myModel") public class MyController{ ... } Suppose that I forget to call status.setComplete() on the SessionStatus like so: @RequestMapping(method = RequestMethod.POST) public void doSomething(@ModelAttribute("m...

generate java domain objects from database table

may i know in eclipse, is there any feature that will auto generate domain objects with all table relationship properly mapped in class? can provide me with some reference articles on this? ...