spring

Web architecture: MVC, Lazy initialization, Data transfer Objects, Open Session In View, is there a concensus approach?

What flaws do you see in the following design, (and what would be your ideal architecture suggestion) for a typical web 3-tier application? My current blueprint approach is very roughly this (assuming Java, Spring, Hibernate, JSP) Controller Stateless, potentially wrapped with a read only transaction (to avoid lazy init exceptions),...

Cannot migrate from spring 2.5 to spring 3.0

Problem is a bit stupid but I can't find any spring3.0-with-dependencies.jar. Is it assumed that I should find all necessary dependencies by myself? May I use dependencies from spring 2.5 in this case? UPD: answer is no, I can't. So, where are the dependencies?? ...

java web applicaton layout, please explain some design principles/patterns

I'm looking at this java web application that is using hibernate, jsp's, and spring framework. (from what I can tell!) the file layout is like this: classes/com/example/project1 inside project1 /dao _entity_Dao.java /dao/hibernate/ _entity_DaoHibernate.java /factory DaoFactory.java DaoFactoryImpl.java /managers ...

File based Spring Security

Hi, I'm working on a Web Service project to provide data to a partner. Our app is really light weight and has only a handful of APIs. Because of time constraint and in-house pre-existing knowledge we went the Spring MVC / Spring Security path to serve those restful APIs. At any rate this is a B2B project where we are expecting only t...

dispatcher servlet not finding url rewritten in filter

I have Spring 3.0 setup with annotated controllers and it is finding my controller and executing it as it should when I send an url to it from a browser . But when rewriting the url with a filter to the exact same that works in the browser I get No mapping found for HTTP request with URI [/test/lookup]. The filter is loaded by a org.spri...

url-action mapping & routing in Spring MVC 3.0

I'm developing a web application using Spring MVC 3.0 and looking for a ready-made solution, if any, or a "best practices" reference for a url/action mapping and routing system that can achieve the following: REST-friendly controller / method name to view mapping. The current mapping implementation translates the request to a view name...

Spring MVC and annotated controllers issue:

I'm having a strange issue with annotated controllers and Spring MVC. I was trying to use Annotated controllers for the sample MVC application that Spring ships with its documentation. I used 2.5 version. When I specify @RequestMapping at type level, I get "HTTP ERROR: 500 No adapter for handler [Controller class name]: Does your handle...

spring transactional cpool. Which one do I use?

I originally set up spring with xapool, but it turns out that's a dead project and seems to have lots of problems. I switched to c3p0, but now I learn that the @Transactional annotations don't actually create transactions when used with c3p0. If I do the following it will insert the row into Foo even through an exception was thrown insi...

example using memcache with jpa entitymanager on JGAE?

any example on using memcache/general cache with jpa entitymanager on JGAE? or the only way to do it is manually put/set memcache on service layer? ...

setting a property in a spring bean outside the spring bean definintion.

I have a spring bean defined outside my control. I want to set a property in that spring bean, is that possible from spring XML? e.g. a.xml (not controlled by me): <bean id="a" class="A"/> <bean id="b" class="B"> <constructor-arg ref="a"/> </bean> b.xml (controlled by me) <import resource="classpath:META-INF/a.xml"/> <bean id="c...

How to get Client IP address in Spring bean

I have define a Spring bean. <beans> <bean id="remoteService" class="edu.wustl.catissuecore.CaTissueApplictionServicImpl" /> </beans> Is there any way to get the IP address of client in this class? Similarly as available in the servlet request.getRemoteAddr(); ...

Transaction error while updating data

Following error occurs while updating a particular data in my web application.I am using HibernateTransactionManager to manage all transactions in the application. Error:- Pre-bound JDBC Connection found! HibernateTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource...

error while implementing spring transaction

I am new to springs. i want to implement JtaTransactionManager in my application instead of HibernateTransactionManager.But i am get following error when i write the following code in my xml. <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/> On server start up following error occur...

What are Dependency Injection & Spring Framework about ?

Possible Duplicates: What is dependency injection? What exactly is Spring for? I want to know What is Spring Framework? Why and when should one use it in Java Enterprise development? The answer would be "A dependency injection framework". All right, what advantages do we have when using dependency injection frameworks? The...

Using JMockit to mock autowired interface implementations

We are writing JUnit tests for a class that uses Spring autowiring to inject a dependency which is some instance of an interface. Since the class under test never explicitly instantiates the dependency or has it passed in a constructor, it appears that JMockit doesn't feel obligated to instantiate it either. Up until now we have been us...

How to generate a dynamic "in (...)" sql list through Spring JdbcTemplate?

Hi, all. Is it possible to generate arbitrary "in ()" lists in a SQL query through Jdbc template: example: "select * from t where c in (#)" , However '#' could be an arbitrary list of values only known at runtime. ...

Spring transaction manager error: Transaction MARKED_FOR_JOINED after isOpen() call

What does the following error message mean? Googling for MARKED_FOR_JOINED doesn't return any useful information. ERROR org.hibernate.AssertionFailure.<init>(AssertionFailure.java:47): an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: ...

How to inject session bean into a POJO using Spring

I am having a EJB 3.0 Session Bean which implements the Local interface, and I have a pure POJO also. How can I inject a Session Bean into the POJO rather than manual JNDI look up in to POJO through spring(using @Resource and SpringBeanAutowiringInterceptor)?. Is there any way to do that? ...

Downloading spring 3.0 with dependencies?

where can i find out spring 3 version with all dependencies? i don't see any such link @ http://www.springsource.com/download/community ...

Spring Dynamic List Binding

I have a typical scenario - I have read many articles on this and dynamic addition seems to work fine. I could not get elegant solution for dynamic delete. A Web Form is simulating a User. User can have name and List of phoneNumbers. phoneNumbers can be added dynamically using Javascript at client side. Dynamic addition of phoneNumber...