spring

Is it better to keep libraries in the application lib or in common/lib?

I'm doing some Spring development and I'm trying to decide if libraries should always be kept in the application lib, even if they end up being common to more than one app. Doesn't Tomcat startup slowdown if a bunch of jar files end up in the common/lib? I'm also fearful of versions and dependencies. Isn't that less of a problem if the a...

Can I find the URL for a spring mvc controller in the view layer?

I think what I need is called reverse url resolution in Django. Lets say I have an AddUserController that goes something like this: @Controller @RequestMapping("/create-user") public class AddUserController{ ... } What I want is some way to dynamically find the url to this controller or form a url with parameters to it from the view (...

How exactly dependency injection is implemented internally in Spring.net?

I'm just curious to know about this.When i heard about Spring.net and tried some sample codes of DI i found it cool and eventually i was curious to know how it works and implemented internally? Even though have the src along with the framework i'm not yet good enough to find out where and how it is done. Is this something to do with Re...

Should I learn Spring 2 or 3?

Spring Framework 3 seems to be right around the corner, but the GA version is 2.5.6. If this is the first time I'm approaching the subject, should I start with the stable version, or should I start with the new version and save myself migration issues? How different is version 3 from version 2? How near is Spring 3? ...

Passing properties to a Spring context

I'm using Spring to handle RMI calls to some remote server. It is straightforward to construct an application context and obtain the bean for remote invocations from within the client: ApplicationContext context = new ApplicationContext("classpath:context.xml"); MyService myService = (MyService ) context.getBean( "myService " ); Howe...

Reference Data Pattern

Similar to this thread, but not exactly: How To Cache Information In A Threadsafe Manner What is the usual pattern for dealing with "reference data" - data that is frequently read by an application, usually externalized in a database or properties file, but updated very infrequently (days, weeks, months)? When the data is updated, it wo...

Can Spring and SWT work together for Java Desktop Applications?

Hi, I am going to design Java Desktop Application. While I was design web application, I got plenty of choice, e.g. Spring, Strut etc. However, for Java Desktop (which is new to me), I don't find any. Is that Eclipse RCP a Java Desktop Framework, which works like Spring mvc in Web apps? I wonder, can I use Spring to enjoy the benefit o...

Spring - How to call a method after bean initialization is complete?

Hi, I have a use case where I need to call a (non-static) method in the bean only-once at the ApplicationContext load up. Is it ok, if I use MethodInvokingFactoryBean for this? Or we have a some better solution? As a side note, I use ConfigContextLoaderListener to load the Application Context in web application. And want, that if bean ...

Java Server application architecture with Swing thin client

I am currently looking to set up a client/server application. I am planning on having the clients written as a Swing thin client. I am not really sure how I should set up the Server side application. The Java Server side application would have the application business logic, database access, etc. I see a lot information on the web abo...

Programmatically set a specific bean object - Spring DI

In my program I need to programmatically configure an ApplicationContext. Specifically, I have a reference to an instance of MyClass and I want to define it as a new bean called "xxyy". public void f(MyClass mc, ApplicationContext ac) { // define mc as the "xxyy" bean on ac ??? ... ... // Now retrieve that bean MyClass bean =...

Spring: How to programmatically define FactoryBean

I want to programmatically setup a FactoryBean on an existing ApplicationContext. There are a lot of examples on how to define a bean programmatically (e.g.: http://www.carlobonamico.com/blog/2008/01/22/how-to-dynamicallyprogrammatically-define-spring-beans/), but they do not work when I try to define a factory bean ...

How to bind a Child collection element to a Parent command class through addChild convenience method (Spring MVC)

Hi, I have a domain class named Parent as follows public class Parent { public List<Child> childList = new ArrayList<Child>(); public void setChildList(List<Child> childList) { this.childList = childList; } public List<Child> getChildList() { return childList; } public void addChild(Child ch...

Spring: Nested application contexts

I have a hierarchy of application contexts. The bean that is defined in the parent context depends on a bean that is defined in the child. Here's how it looks like: public class X { public static class A { public B b; public void setB(B b) { this.b = b; } } public static class B { } public static...

How to integrate spring with GWT?

If I understand correctly, it's more efficient to use spring as a mediator for object persistence than using ibatis directly. There seem to be a lot of libraries which ease spring integration by implementing a dispatcher for gwt rpc calls. Would you recommend gwtrpc-spring or gwt-widgets? ...

grails web flow exception handling

Hi, In my Grails app, I have defined the following (simplified) web flow def registerFlow = { start { action {RegistrationCommand cmd -> try { memberService.validateRegistrationCommandDTO(cmd) } catch (MemberException ex) { flow.regErrorCode = ex.err...

Spring - @Transactional - What happens in background?

I want to know what actually happens when you annotate a method with @Transactional? Of course, I know that Spring will wrap that method in a Transaction. But, I have the following doubts: I heard that Spring creates a proxy class? Can someone explain this in more depth. What actually resides in that proxy class? What happens to the a...

Deploying a Spring-based WAR with its JAR dependencies externalized.

I have a Spring app that has a lot of dependencies (18 megabytes of JAR files..) - Now, when I am testing on the remote Tomcat 6.0 server, I'd like to not have to upload that 19 megabytes of dependencies, and just upload the classes. Pretty simple, right? I can't get the damn thing to work. I'm using Eclipse 3.4, and if in Java Build ...

How can I find the error when Tomcat fails to start my Spring/Hibernate web application?

I have a Spring/Hibernate application which I have converted into a web application in order to provide RESTful web services (using Jersey). I am trying to deploy the web application onto Tomcat 6.0.20 and I get only a cryptic error message in the log file: Jul 8, 2009 2:25:22 PM org.apache.catalina.core.StandardContext start SEVERE: E...

How to get the certificate into the X509 filter (Spring Security)?

Hi, I need to extract more information than just the CN of the certificate. Currently, I only get the standard UserDetails loadUserByUsername(String arg) where arg is the CN of the certificate. I need to get the X509Certificate object. Is it possible? on spring security xml file : <x509 subject-principal-regex="CN=(.*?)," user-servic...

Javax package and simple java application with spring hibernate

hello people! in my attempt to learn a bit faster the use of spring and hibernate i read few chapter on books and created a simple java project from netbeans 6.7. I've decided to use the hibernate annotations instead of mapping files.so in my pojo i import javax.persistence.*; and i have an error that javax doesn't exist.what sound surpr...