spring

Google App Engine - can't operate on multiple entity groups in a single transaction

Why am I receiving the exception below if the type of both entities is PersistentLogin? I thought that would mean they are in the same entity group, but I guess that is an incorrect assumption. Any ideas how to fix this? This is the code: // the class is marked with @Transactional @Override public final void removeUserTokens(final Stri...

Thought on Code to Interface in Spring?

I know in spring we all code to interface. So the implementation class should not be known to outside world at all. But it is a public class so anyone make an instance of the implementation class also. How do you prevent this? Do you make the constructor private? Since spring creates an instance of through reflection, it should be fine. ...

How do I use Spring's IdToEntityConverter to do my Entity Type Conversion during form binding?

I'm sick of writing extending PropertyEditorSupport for every single Entity in my system. I notice that Spring 3.0 has an IdToEntityConverter, but there is really not much documentation on how to use it. Please comment on the best generic way to convert between id and entity. ...

During Spring unit test, data written to db but test not seeing the data

I wrote a test case that extends AbstractTransactionalJUnit4SpringContextTests. The single test case I've written creates an instance of class User and attempts to write it to the database using Hibernate. The test code then uses SimpleJdbcTemplate to execute a simple select count(*) from the user table to determine if the user was per...

Hibernate performs a Delete on a Select

Hi Guys, I'm facing a problem with Hibernate. My current project is a little game. In this game you have a Board which has many Fields each with a Token. I can make a select on an empty database without any problems but if I put one object into it (saving works without any exceptions and after it the database values looks good) I'm getti...

Duplicate form submission in Spring

What's the best way of avoiding duplicate form submission in Spring. Does this framework provide any special feature to handle this problem (for example as tokens in Struts)? Thanks. ...

How to set up multi-threading in Spring Batch?

I've successfully set up a tutorial Spring Batch project. I'd really like to know if it's possible to make it multi-threaded at the "Spring level". The basic idea of what I want is to make a list of tasks or task steps and let them be picked up and worked on by independent threads, ideally out of a pool limited to 'n' number of threa...

ActiveMQ created with localhost VM does not create JMX Beans

This question comes from here but can be a totally independent question. I have a unit test with Spring 2.5.2 and activemq 5.2.0. I create a broker (useJmx is true) using "vm://localhost", fire a couple of messages to "myTopic1" open a jconsole to this process and I see MBeans under org.apache.activemq -> localhost -> Topic -> ActiveMQ....

Session management between thick client and server?

My application is a Eclipse Rich Client and I would like to add authentication and authorization features to. My Users and roles are stored in a database and my application also has a web based admin console which lets me manage users and roles. I am leveraging Spring security on this admin console. So here's my requirement: I would ...

a couple of questions regarding design

I would like to hear what do you think about the design of this issue. I have to write webservice to allow user to modify dictionaries in database. I got xml schema which looks like this (it's simplified): AdminService which is a root and has a choice with: AddCode[@DictionaryName, @Code, @Description] RemoveCode[@DictionaryName, @C...

How to bind IP address to a Spring 3 @ModelAttribute?

Here's how my method looks like: @RequestMapping(value = "/form", method = RequestMethod.POST) public String create(@ModelAttribute("foo") @Valid final Foo foo, final BindingResult result, final Model model) { if (result.hasErrors()) return form(model); fooService.store(foo); return "redirect:/foo"; } So, I n...

Calling class methods (static) from inside a velocity view page

Can you call class methods from inside a view page? Specifically ones that are not passed into the view? i.e. In asp.net MVC I can do this: <%= SomeClass.FixDateFormat(ViewData.Model.SomeClass.DateCreated) %> ...

Where to store database passwords in a spring application or use JNDI?

Seems like a simple task. I have a webapp which requires a database connection. I'd like to be able to drop an updated .war file on this app server and load a new version without having to re-edit an applicationConfig.xml file to specify the database connection parameters for production. Is using the container to setup the data source ...

Spring - Rewrite one URL to another

I have a Spring 2.5 application that contains a Flash banner. I don't have the source for the Flash component but it has links hardcoded to certain pages that end in .html I want to be able to redirect those .html pages to existing jsp pages. How can I have Spring resolve a few .html pages to .jsp pages? My project looks like: WebCo...

SessionAttribute and SpringFramework

How can I set session attribute using spring framework and annotation? Something equivalent to request.getSession().setAttribute("key", "value"); Thanks. ...

IllegalArgumentException for dataSource in Spring application

Hello all, I am trying to deploy a simple spring app. It takes a username(from a jsp), insets the value into a db and displays a greeting on a new jsp page saying hello!, [username]. My environment is: OS: windows xp professional Db: MS access (this is just for trying things out at first, intend to shift to mySQL) IDE: eclipse Server...

How to include a parent Spring project (using Git submodule)?

I'm currently developing multiple web applications using Spring. I'm using Maven for building and Git for version control. At the moment I'm trying to find a way to split development of some things used by all webapps, e.g. I have some helper classes that are the same for all projects. The problem is, I don't want to use only classes, bu...

How to match a Spring @RequestMapping having a @pathVariable containing "/" ?

Hi I am doing the following request from the client: /search/hello%2Fthere/ where the search term "hello/there" has been URLencoded. On the server I am trying to match this URL using the following request mapping: @RequestMapping("/search/{searchTerm}/") public Map searchWithSearchTerm(@PathVariable String searchTerm) { // more co...

Google App Engine - Spring Security Issue (java.security.AccessControlException)

I'm currently getting the AccessControlException below when I deploy to app engine (I don't see it when I run in my local environment). I'm using GAE 1.3.1, Spring 3.0.1, and Spring Security 3.0.2. Any ideas how to get around this issue? It appears to be an issue with Spring Security trying to get the system class loader, but I'm not sur...

Deserialized bean needs scoped dependencies

How can I inject dependencies into a deserialized bean? Some of my Spring beans should be serialized during the render-response phase of our JSF application, and then deserialized at the beginning of the next request. Some of those beans have dependencies which are scoped to the request. If I configure the dependencies with the scoped...