spring

How to batch delete using bulkUpdate

I have a common User / Role setup, with a user_role join table. I'm trying to use Spring's HibernateTemplate to mass delete all locked users like this: getHibernateTemplate().bulkUpdate("delete from User where locked=?", true); If the user being deleted does not have any roles (no record in the user_role table), then everything goes f...

Intent of Spring form command

Spring's form controller (such as SimpleFormController or BaseCommandController) uses commands to pass data between the HTML form and controller. My question is, is it common practice to use the backing model as the command itself? Or is it common to create a separate command with correspond attributes to those in the backing model. My ...

Can a Spring form command be a Map?

Can a Spring form command be a Map? I made my command a Map by extending HashMap and referenced the properties using the ['property'] notation but it didn't work. Command: public class MyCommand extends HashMap<String, Object> { } HTML form: Name: <form:input path="['name']" /> Results in the error: org.springframework.beans.NotR...

daemon threads in an app container

I read in a post to the Smack forum recently that Starting daemon threads in a Java EE server is a big no no Basically Smack's XMPPConnection starts one daemon thread to monitor incoming data & another to send outgoing data from/to the jabber server respectively. Is it reasonable to use daemon threads to listen for write/reads in ...

Spring: No transaction manager has been configured

Hi all, I've been wrestling with this problem for a while, and don't see a solution. Hope anyone can help me. I have a HibernateTransactionManager configured. However, I see the following message in the log file: DEBUG [http-8080-1] AnnotationTransactionAttributeSource.getTransactionAttribute(107) | Adding transactional method [cashIn...

Acquiring a spring configuration value from a custom class

I'm considering using Spring to assemble the components of my application, but I've got a problem. Our application uses a configuration repository that is global to the VM, and is similar (but not precisely) to the system properties. This configuration API is accessed like so: Configuration.getDb ().get ("some_property_name") Is the...

How do you make a multi-module spring configuration ?

I have a multi-module (maven) spring build. All the modules publish some beans, and most also consume beans defined further down the dependency graph. Although most of it is annotation declared beans, almost every module also has one or two xml-declared beans. Although we have a half-decent solution, but I am really wondering what is th...

Eclipse JSP preview

Is there an Eclipse plugin or feature that allows previewing of JSP files? Ideally such a feature would be aware of Spring tags. It's a major pain to edit the JSP in Eclipse, then build and deploy to see the results. ...

How to XML configure Spring bean for constructor injection when bean has varargs constructor

Is there a way to write a Spring bean in XML so that it uses constructor injection when that constructor has a varargs parameter type? IE, is there a way to specify an array the way you can specify a list? For instance: class MyClass { MyClass(String... args) { // rest omitted } } ...

[STRUTS 2.1.6] SessionAware does not inject session Object

Hello guys, Once more here I come with a question of s2, i'm a beginner at it and got some trouble finding examples. I'm build a menu service wich depends upon a login, wich is give when the user enter at start page. Once the login has been made, I store the user object into the session by doing the follow: @Override public String int...

Any good tutorials for JMS + EMS + Spring?

I have been searching the web, but can't find any good tutorials for getting started with JMS under Spring connecting to TIBCO EMS. Anyone can point me to a good one? ...

What are the design patterns which used in Spring framework?

What are the design patterns which used in Spring framework? ...

Automatic Hibernate Transaction Management with Spring?

How far does the spring framework go with transaction handling? My reading of the book "Spring In Action" suggestions with its examples that you create DAO methods that don't worry about Session and Transaction management fairly simply by setting up a session factory and transaction template in XML and then wiring them into your DAO. Spr...

Areas of focus for a Java independent study?

I have an independent study next semester and would like it to be something that applies to future job prospects. I've interned at a company for the passed several years that uses Spring, Hibernate, and ServiceMix. I'd like to learn these technologies during my independent study so I can hit the ground running if I get hired there. Does ...

Different views with Spring's SimpleFormController

I'm using Spring's SimpleFormController for form processing. In my case, the edit view (JSP) can vary depending on what's being edited. SimpleFormController's formView is a field (class variable) which means that it's shared by all threads that use the instance of it. Thus it's not safe (nor appropriate) to set the formView (via setFormV...

WPF + IoC: "Specified Visual is already a child of another Visual or the root of a CompositionTarget."

[Edit: Rethinking architecture along mvvm lines made this problem largely fall away - thanks @kent] Using Spring.NET + WPF. Load two WPF buttons in the config: <object name="Button1" type="System.Windows.Controls.Button, PresentationFramework" > <property name="Name" value="Next" /> <property name="Width" value="200"/> <property...

What is the best Java-way to create JSON/XML REST Web services that is similar to WCF?

I'm looking for a best way that is available for Java developers to implement REST services that will be communicating via JSON or XML. I'm looking for production-ready products. I know that Spring 3.0 is coming, but it's not done yet - no luck. Is Jersey the one? My application is hosted by Tomcat, uses Spring, Jettison and XStream....

Jersey in Tomcat+Spring environment can't find ComponentProvider. Why?

I've deployed Jersey on Tomcat and everything works perfectly (when I use the com.sun.jersey.spi.container.servlet.ServletContainer), but as soon as I change it to the com.sun.jersey.spi.spring.container.servlet.SpringServlet (according to all the tutorials I can find), I get a nasty exception: Apr 19, 2009 5:07:35 PM org.apache.catalin...

Avoiding in-place pointcut expression in Spring AOP

Hi, I'm using Spring AOP. I'm giving my pointcuts like: @Pointcut("execution(* com.demo.Serviceable+.*(..))") public void serviceMethodCalls() { } Is it possible to avoid the in-place pointcut expression in Spring AOP? Thanks, Veera. ...

Hibernate/JPA inheritance issue on weblogic

Im getting a weird error when running my spring2.5.6,jpa(hibernate3.4) webapp in weblogic 10.3 [ERROR] Javassist Enhancement failed: com.xxx.domain.model.Scheme java.lang.NoSuchMethodError: pcGetManagedFieldCount at com.xxx.domain.model.Fund.<clinit>(Fund.java) at sun.misc.Unsafe.ensureClassInitialized(Native Method) ...