spring

General Question on Large J2EE web application, clearly separate application by modules. Possible use of business delegate pattern

Before I ask my "general" question, I wanted to present some quotes to my high-level general understanding of the business delegate pattern: "You want to hide clients from the complexity of remote communication with business service components." "You want to access the business-tier components from your presentation-tier components and...

Spring Calls Object Constructor Before Setting Properties

I have an abstract class, Foo, that has a non-abstract method called Bar. I have a class Baz that extends Foo and has its own unique constructor. By default, when Spring instantiates the Baz class upon startup, it will call the Baz constructor before passing values into parent class' method, Bar. Is there a way to override this behav...

How to call Spring web service from RPG ?

We have developed SOA architecure for our intranet application, so our web-start java applications are connected to central app. server which is running on Spring HttpInvoker, things work pretty well. Now, we came up with need to centralize our business logic, so our need is to call these web services from DB2 RPG stored procedures. Is t...

How many modules are there in Spring? What are they?

just i want to know How many modules are there in Spring? What are they? ...

dynamically change spring beans

hi, how do I dynamically change the properties of a bean at runtime using java spring? I have a bean mainView, which should use as property "class" either "class1" or "class2". This decision should be made on base of an property-file, where the property "withSmartcard" is "Y" or "N". ApplicationContext: <bean id="mainView" class="m...

In Spring Webflow unit test, how do you assert that a view state has a view of a given name?

I'm developing a Spring webflow, trying to use TDD so I've extended AbstractXmlFlowExecutionTests. I can't see an obvious way to assert what I would have thought would be a simple thing: that a view state has an associated view of a given name. For example, given this flow (excerpt): <?xml version="1.0" encoding="UTF-8"?> <flow ...> ...

Defining spring bean using a class with generic parameters

If I have a class that looks something like this: public class MyClass<T extends Enum<T>> { public void setFoo(T[] foos) { .... } } How would I go about declaring this as a bean in my context xml so that I can set the Foo array assuming I know what T is going to be (in my example, let's say T is an enum with the values ONE and...

call 2 or more views with one controller in spring java

hi guys and girls. i want to call 2 views within one controller in spring with java. for example this.controller.view('header'); this.controller.view('body'); this.controller.view('footer'); how can i do that? or it is possible in spring? or can you suggest any other way to do it? and can i call a view inside a view. for example in v...

Is anyone using SpringSource tc server as a Tomcat replacement?

It looks like SpringSource has just released a GA version of their tc Server application server. It sounds from their description like it is a drop-in replacement for Apache Tomcat, with better "enterprise capabilities", such as "advanced diagnostics", better operations management, deployment, etc. (and of course, the support that they ...

I'm interviewing for a j2EE position using the Spring Framework; help me brush up

I'll be interviewing for a J2EE job using the Spring Framework next week. I've used Spring in my last couple of positions, but I probably want to brush up on it. What should I keep in mind, and what web sites should look at, to brush up? ...

annotations in Spring MVC

Hi, I'd like to convert this SimpleFormController to use the annotation support introduced in Spring MVC 2.5 Java public class PriceIncreaseFormController extends SimpleFormController { ProductManager productManager = new ProductManager(); @Override public ModelAndView onSubmit(Object command) throws ServletE...

Is fine grained control of aspectj-autoproxy possible in spring ?

If I just add <aop:aspectj-autoproxy proxy-target-class="false"/> to the start of my spring context, every single bean that implements an interface gets a JDK proxy. I would really like to limit the proxying A) to classes that actually need proxies or B) classes that I specify as needing proxies. I tried using the aop:scoped-proxy stanz...

Do I want to minimize the scope of @Transactional?

Not sure if 'scope' is the correct term here. I am using Spring for JPA transaction management (with a Hibernate underneath). My method to preform database transaction is private, but since you can only set @Transactional on a class or on a public method Since this mechanism is based on proxies, only 'external' method calls coming i...

Spring + JPA (Hibernate) on Glassfish --> ClassVisitor problem

I'm trying to write a simple web app with Spring 2.5 (core + MVC) and JPA (using Hibernate for the persistence mechanism). Every time I deploy, I'm getting a "Class not found exception" that points to ClassVisitor. This is a known version problem with the asm library. In a stand-alone app, I can make sure that the proper asm version i...

Auto-cast Spring Beans

Is there a way to auto-cast Spring beans to the class defined in the application context XML? I'd like to avoid putting type information about the beans in 2 places.... in the xml configuration file and also in the code as a cast. For instance, given this config file <bean id="bean-name" class="SimpleSpringBean" scope="prototype"> ...

Why is Spring's ApplicationContext.getBean considered bad?

I asked a general Spring question and had multiple people respond that calling Spring's ApplicationContext.getBean() should be avoided as much as possible. Why is that? How else should I gain access to the beans I configured Spring to create? I'm using Spring in a non-web application and had planned on accessing a shared Application...

in Spring.config, can I define object of type string?

Can I do something like this: <object id="mydb" type="string"> <value>"blah"</value> <-- note that <value> tag does not really exist </object> So that I could use it later like so: <object id="Someobject" type="Sometype"> <property name="ConnectionString" ref="mydb"/> </object> EDIT: this was SpringFramework.NET sol...

JPA not saving foreign key to @OneToMany relation

I'm using Spring with Hibernate as a JPA provider and are trying to get a @OneToMany (a contact having many phonenumbers) to save the foreign key in the phone numbers table. From my form i get a Contact object that have a list of Phone(numbers) in it. The Contact get persisted properly (Hibernate fetches an PK from the specified sequence...

Spring online repository for Maven

I've just installed Maven2 for the first time. By default it pulls down a few useful jars into a local project: jakarta-commons, junit etc. I wanted to pull in the latest Spring release (2.5.6 at the time of writing). But the online repositories I looked at (iBiblio and Maven) only had much older versions of Spring libraries. Are the...

Setup and Tear Down of Complex Database State With Hibernate / Spring / JUnit

I have a class I'm unit testing that requires fairly extensive database setup before the individual test methods can run. This setup takes a long time: for reasons hopefully not relevant to the question at hand, I need to populate the DB programatically instead of from an SQL dump. The issue I have is with the tear-down. How can I eas...