spring

Spring - Call custom-authentication-provider from a controller

I have a custom-authentication-provider defined in my Spring Security configuration. This class implements AuthenticationProvider, and I can successfully log in using the form defined on my page. The issue is I want to call this class not just on the login page, but from the registration page as well. The registration page uses a dif...

Tomcat Spring WebApplicationContext

In the Spring framework reference I found this: The ApplicationContext interface has a few other methods for retrieving beans, but ideally your application code should never use them. Indeed, your application code should have no calls to the getBean method at all, and thus no dependency on Spring APIs at all. but I have no idea to...

Spring @Transactional annotation not working with auto-wiring?

My application uses Spring auto-wiring to configure the beans. I have just tried adding @Transactional and the expected proxies do not seem to be called. I want the PersonalController to call UpdatePublicMapService with the UpdatePublicMapService wrapped by the transaction proxy. What I see is that the PersonalController is instantiated...

Cannot resolve the name 'xenc:EncryptionMethodType' to a(n) 'type definition' component.

Hello, I am trying to deploy a war file in JBOSS 5.1 with CXF-JAXB schema validation. I have a XSD which has imports as <xs:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/&gt; <xs:import namespace="http://www.w3.org/2001...

How to configure log4j to log Spring injections

How can I configure log4j to write an entry to the log every time it injects a class? My use case is this: I have Autowiring enabled. I have some interfaces with multiple implementing classes. I want to be able to see in the log which impl class gets injected to another class. Any thoughts? ...

Spring + Maven: separate property files for unit tests and integration tests

I'm using Spring 2.5.6 and building my project with Maven 2.2.1. We use PropertyPlaceholderConfigurer beans in Spring to load up properties for configuring things like the database. Pretty standard stuff. We also have two different sets of tests: unit tests and integration tests. I would like to be able to use different property files ...

I am using jsf, hibernate and Spring in my project and now i need to implement JBPM(JBOSS)

hello I am using jsf 2.0, hibernate and Spring in my project and now i need to implement JBPM(JBOSS) and totally i am new to jbpm and using glassfish server so how can i add this stuff... ...

PropertyPlaceholderConfigurer reads from XML File (Apache Commons Configuration)

Is there a possibility to configure the Spring PropertyPlaceholderConfigurer to read from properties.xml, via Apache Commons Configuration? ...

How to embed Jetty into Spring and make it use the same AppContext it was embedded into?

I have a Spring ApplicationContext where I declare Jetty server bean and start it. Inside Jetty I have a DispatcherServlet and a couple of controllers. How to make that DispatcherServlet and its controllers use beans from the same ApplicationContext where Jetty is declared? In fact, in that outer context I have a couple of daemon-like b...

GWT Spring security - Client

Hi Again, I have managed to integrate spring security to my GWT application using the following approach: http://technowobble.blogspot.com/2010_05_01_archive.html Note that I used the gwtrpcspring library for basic spring integration with GWT and it works well (non-invasive and efficient). My question for which I can't seem to find t...

Inserting multiple rows using JdbcTemplate

How can I execute the following SQL in a scalable way using JdbcTemplate running on mySQL. In this case, scalable means: Only one SQL statement is executed on the server it works for any number of rows. Here's the statement: INSERT INTO myTable (foo, bar) VALUES ("asdf", "asdf"), ("qwer", "qwer") Assume that I have a list of POJO'...

Spring Eclipse Plugin update site

Can anyone point me to spring-eclipse plug-in update location so I can use spring from my Eclipse IDE? None of the ones I found online are working! ...

Should i use the latest version of Spring

I am just starting to learn about spring and was looking at the difference between Spring 3.0 and Spring 2.5. Initially i was following this tutorial http://static.springsource.org/docs/Spring-MVC-step-by-step/index.html which is a step by step guide to developing a Spring MVC application. It is based on Spring 2.5 and i notice there a...

How to configure a custom Spring PerformanceInterceptor for a Resource Method

I'm using Java/Spring/Jersey v1.0.3/Jboss. I want to configure a PerformanceInterceptor for my resource. How can I do this? Let's say I have the following configuration: <bean id="service" class="com.services.RESTfulService" /> <bean name="servicePointcut" class="org.springframework.aop.support.NameMatchMethodPointcut"> <property name="...

spring IOC, can I drop a .jar that adheres to an interface and modify the app-config.xml?

Say I have a database layer, with DTO's for each table, and a factory that returns the DTO's for each table. As long as I build to interfaces, I can re-implement the db layer and then just change my app-config.xml to use another implementation. Now, is it possible for me to have this new implementation in another .jar file? The goal...

Any Spring Framework support for REST security?

I am about to implement security for my RESTful services based on the Spring framework. Actually, I have never secured RESTful WS before, but I've got myself a good introduction here. Basically, Amazon S3 or even OAuth are suggested as good examples. My questions: Does the Spring framework provide these strategies out-of-the-box? If ...

Which Jetty distribution to download to run a full blown Spring3.0 app?

I have noticed, that as of V7.x, there are two stand-alone distributions of Jetty. A Codehouse and an Eclipse distribution. Which one do I need to download if I want to run a full-blown Spring 3.0 (incl. Spring MVC/Webflow/Security, Annotations, Hiberate, REST, JSF, Comet ...) application? How to add missing depedencies? Since I would l...

Use stored procedure when getting blob at spring mvc

Hi, I wanted to learn how to use Stored Procedure when inserting BLOB data on my MSSQL Table. final File blobIn = new File("spring2004.jpg"); final InputStream blobIs = new FileInputStream(blobIn); final File clobIn = new File("large.txt"); final InputStream clobIs = new FileInputStream(clobIn); final InputStreamReader clobReader = new...

Using new in Spring framework applications?

Is it forbidden or not a best practice to create objects using new. Creating objects means like Helper objects for some specific tasks that are no way related to the request, but are just used to perform some background tasks like reading a local file, database etc ...

Spring JPA - Injecting transaction manger vs injecting entity manager

If I wanted manage transactions programmatically, what is the difference between starting the transaction by injecting a PlatformTransactionManager vs directly injecting EntityMangerFactory/EntityManager and getting transaction from Entitymanager public class MyDAO { @PersistenceContext(unitName="test") EntityManager em; JpaTransactio...